#include <bits/stdc++.h>
using namespace std;
int kSum(int n) {
  int r = 0;
  while (n != 0) {
    r += (n % 10);
    n /= 10;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int k;
  cin >> k;
  long long ans = 18;
  while (k) {
    ans++;
    if (kSum(ans) == 10) {
      k--;
    }
  }
  cout << ans;
  return 0;
}
