#include <bits/stdc++.h>
using namespace std;
int ten(int i) {
  int cnt = 0;
  while (i != 0) {
    cnt += (i % 10);
    i /= 10;
  }
  return cnt;
}
int main(void) {
  int k, i;
  long long ans = 18;
  cin >> k;
  while (k != 0) {
    ans++;
    if (ten(ans) == 10) k--;
  }
  cout << ans;
}
