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