#include <bits/stdc++.h>
using namespace std;
unsigned int pinf = numeric_limits<unsigned int>::max();
unsigned int minf = numeric_limits<unsigned int>::min();
const int MOD = 998244353;
const int N = (3e5) + 10;
int mul(int a, int b) { return (a * 1LL * b) % MOD; }
int add(int a, int b) { return (a + b) % MOD; }
int nbsum(int x) {
  int sum = 0;
  while (x) {
    sum += (x % 10);
    x = x / 10;
  }
  return sum;
}
int n;
int main() {
  scanf("%d", &n);
  int ans = 18;
  while (n) {
    ans++;
    if (nbsum(ans) == 10) n--;
  }
  cout << ans << endl;
  return 0;
}
