/**
 * Author: Sergey Kopeliovich (Burunduk30@gmail.com)
 * Date: 2013.10.23
 */

#include <cstdio>
#include <cassert>
#include <algorithm>

using namespace std;

#define forn(i, n) for (int i = 0; i < (int)(n); i++)

int main( int argc, char *argv[] )
{
  int n = atoi(argv[1]);
  int *a = new int[n];
  forn(i, n)
    a[i] = i;
  random_shuffle(a, a + n);
  printf("%d\n", n);
  forn(i, n)
    printf("%d ", a[i] + 1);
  return 0;
}