#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 19;
  int i = 1;
  int k;
  cin >> k;
  for (i = 1; i < k;) {
    ans = ans + 9;
    int q = ans, r = 0;
    while (q != 0) {
      r = r + q % 10;
      q = q / 10;
    }
    if (r == 10) i++;
  }
  cout << ans;
  return 0;
}
