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

#define maxn 8000000

char res[maxn], was[maxn];
int rn;


int main( void )
{
  freopen("string.in", "r", stdin);
  freopen("string.out", "w", stdout);

  int n;
  scanf("%d", &n);

  assert(1 <= n && n <= 500);

  for (int i = 1; i <= n; i++)
    if (!was[i])
    {
      char tmp[10];
      sprintf(tmp, "%d", i);
      int tn = strlen(tmp);
      for (int j = 0; j < tn; j++)
      {
        res[rn] = tmp[j] - '0';
        int x = 0, mul = 1;
        for (int k = 0; k < 6 && rn - k >= 0; k++)
        {
          x += res[rn - k] * mul;
          mul *= 10;
          was[x] = 1;
        }
        rn++;
      }
    }
  for (int i = 0; i < rn; i++)
    res[i] += '0';
  printf("%s\n", res);


  return 0;
}
