#include <bits/stdc++.h>
using namespace std;
int abcd(int n) {
  int sum = 0;
  while (n) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main() {
  int k;
  cin >> k;
  int ans = 0;
  while (k) {
    ans++;
    if (abcd(ans) == 10) k--;
  }
  cout << ans << endl;
}
