import java.util.*;
import java.io.*;

public class sump_as implements Runnable {
    class State implements Comparable<State> {
        int sum;
        int prod;
        int last;
        int count;


        public State(int sum, int prod, int last, int count) {
            this.sum = sum;
            this.prod = prod;
            this.last = last;
            this.count = count;
        }

        public int compareTo(State o) {
            if (sum != o.sum) {
                return sum - o.sum;
            } else if (prod != o.prod) {
                return prod - o.prod;
            } else if (count != o.count) {
                return count - o.count;
            } else {
                return last - o.last;
            }
        }


        public int hashCode() {
            return ((sum * 29 + prod) * 29 + count) * 29 + last;
        }

        public boolean equals(Object obj) {
            State o = (State) obj;
            return o.sum == sum && o.prod == prod && o.last == last && o.count == count;
        }
    }

    int solve(int n) {
        PriorityQueue<State> states = new PriorityQueue<State>();
        HashMap<State, Integer> num = new HashMap<State, Integer>();
        for (int i = 2; i <= n; i++) {
                State s = new State(i, i, i, 1);
                states.add(s);
                num.put(s, 1);
        }

        int ans = 0;
        while (!states.isEmpty()) {
            State s = states.poll();
            if (s.prod - s.sum == n - s.count) {
                ans += num.get(s);
            }

            for (int i = s.last; i <= n; i++) {
                State t = new State(s.sum + i, s.prod * i, i, s.count + 1);
                if (num.containsKey(t)) {
                    num.put(t, num.get(t) + num.get(s));
                } else {
                    if (t.prod - t.sum <= n - t.count) {
                        num.put(t, num.get(s));
                        states.add(t);
                    }
                }
            }
        }

        return ans;
    }

    public void solve() throws IOException {
        Scanner in = new Scanner(new File("sump.in"));
        PrintWriter out = new PrintWriter("sump.out");

        int n = in.nextInt();

        out.println(solve(n));

        in.close();
        out.close();
    }

    public void run() {
        try {
            solve();
        } catch (IOException e) {
        }
    }

    public static void main(String[] arg) {
        new Thread(new sump_as()).start();
    }
}