#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main() {
  int N;
  cin >> N;
  vector<string> pre;
  for (int i = 0; i < N; ++i) {
    vector<string> ans;
    if (i == 0)
      ans.push_back("0");
    else {
      int ma = 0;
      for (int j = 0; j < pre.size(); ++j) {
        int hoge = stoi(pre.at(j));
        ma = max(ma, hoge);
        for (int k = 0; k <= ma + 1; ++k) {
          ans.push_back(to_string(max(ma, k)));
        }
      }
    }
    pre = ans;
  }
  cout << pre.size() << endl;
}
