#include <cstdio>
#include <cstring>
#include <cassert>

#define m 10010

char s[m], t[m];
int l = 0, k;

int main()
{
  freopen("string.in", "r", stdin);
  freopen("string.out", "w", stdout);
  scanf("%d", &k);
  assert(1 <= k && k <= 500);
  s[l] = 0;
  for (int i = 1; i <= k; i++)
  {
    sprintf(t, "%d", i);
    if (!strstr(s, t))
      sprintf(s + l, "%s", t), l += strlen(t);
  }
  puts(s);
  return 0;
}
