#include <bits/stdc++.h>
using namespace std;
int sum(int N) {
  int ans = 0;
  while (N) {
    ans += N % 10;
    N /= 10;
  }
  return ans;
}
int main() {
  int N;
  cin >> N;
  int count = 0;
  int i = 1;
  for (; count != N; ++i)
    if (sum(i) == 10) ++count;
  cout << i - 1 << endl;
}
