#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e8;
const int o_o = 0;
double EPS = numeric_limits<double>::epsilon();
int sum(int x) {
  int s = 0;
  while (1) {
    int r = x % 10;
    s += r;
    x = x / 10;
    if (x == 0) {
      return s;
    }
  }
}
int n;
int main() {
  std::ios_base::sync_with_stdio(0);
  scanf("%d", &n);
  int c = 18, j = 0;
  while (n) {
    c++;
    if (sum(c) == 10) {
      n--;
    }
  }
  printf("%d\n", c);
}
