#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <queue>
#include <utility>
#include <set>
#include <iomanip>
#include <ctime>
using namespace std;
#define ll long long
#define pi 3.141592653589793
#define pb push_back
#define forto(l,a,b) for(long long l = a; l <= b; ++l)
#define downto(l,a,b) for(long long l = a; l >= b; --l)
#define Fred_Flinstone ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ln '\n'
#define decimal cout<<fixed<<setprecision(15)
int x[1234];
int cnt;
bool cmp(long a, long b){
string s;
//cout << "1 " << a << ' ' << b << ln;
//cout << flush;
//cin >> s;
cnt++;
s = x[a] < x[b] ? "Y" : "N";
if (s[0] == 'Y') return 1;
return 0;
}
int main()
{
Fred_Flinstone;
long n;
vector< long > v;
cin >> n;
forto(f, 1, n){
x[f]=rand()%100000;
v.pb(f);
}
sort(v.begin(), v.end(), cmp);
cout << cnt << "\n";
return 0;
cout << "0 ";
forto(f, 0, n-1){
cout << v[f] << ' ';
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGlvPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDxxdWV1ZT4KI2luY2x1ZGUgPHV0aWxpdHk+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxpb21hbmlwPgojaW5jbHVkZSA8Y3RpbWU+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSBwaSAzLjE0MTU5MjY1MzU4OTc5MwojZGVmaW5lIHBiIHB1c2hfYmFjawojZGVmaW5lIGZvcnRvKGwsYSxiKSBmb3IobG9uZyBsb25nIGwgPSBhOyBsIDw9IGI7ICsrbCkKI2RlZmluZSBkb3dudG8obCxhLGIpIGZvcihsb25nIGxvbmcgbCA9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