#include <bits/stdc++.h>
using namespace std;
long long int cal(long long int n) {
  long long int s = 0;
  while (n) {
    s += n % 10;
    n /= 10;
  }
  return s;
}
int main() {
  long long int t, s = 0;
  cin >> t;
  long long int n = t;
  while (t) {
    s++;
    if (cal(s) == 10) t--;
  }
  cout << s << endl;
}
