#include <bits/stdc++.h>
using namespace std;
long su(long i) {
  long cnt = 0;
  while (i) {
    cnt += i % 10;
    i /= 10;
  }
  return cnt;
}
double getsu(long n) { return double(n) / su(n); }
using P = pair<double, int>;
int main() {
  long k;
  cin >> k;
  if (k == 1) {
    cout << 1 << endl;
    return 0;
  }
  cout << 9 + 10 * (k - 1) << endl;
}
