#include <iostream>
#include <vector>
using namespace std;
const int maxN = 100000;
// bool u[maxN];
int a[maxN];
int b[maxN];
int main() {
int N;
cin >> N;
vector<bool> u(N);
long long total = 0;
for (int i = 0; i < N; ++i) {
a[i] = rand() % N;
b[i] = rand() % N;
}
for (int it = 0; it < N; ++it) {
for (int i = 0; i < N; ++i) {
int x = a[i];
u[x] = 1;
}
for (int i = 0; i < N; ++i) {
int x = b[i];
u[x] = 0;
}
for (int i = 0; i < N; ++i) {
total += u[i];
u[i] = 0;
}
}
cout << total / N << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IG1heE4gPSAxMDAwMDA7Ci8vIGJvb2wgdVttYXhOXTsKaW50IGFbbWF4Tl07CmludCBiW21heE5dOwppbnQgbWFpbigpIHsKICAgIGludCBOOwogICAgY2luID4+IE47CiAgICB2ZWN0b3I8Ym9vbD4gdShOKTsKICAgIGxvbmcgbG9uZyB0b3RhbCA9IDA7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IE47ICsraSkgewogICAgICAgIGFbaV0gPSByYW5kKCkgJSBOOwogICAgICAgIGJbaV0gPSByYW5kKCkgJSBOOwogICAgfQogICAgZm9yIChpbnQgaXQgPSAwOyBpdCA8IE47ICsraXQpIHsKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47ICsraSkgewogICAgICAgICAgICBpbnQgeCA9IGFbaV07CiAgICAgICAgICAgIHVbeF0gPSAxOwogICAgICAgIH0KICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47ICsraSkgewogICAgICAgICAgICBpbnQgeCA9IGJbaV07CiAgICAgICAgICAgIHVbeF0gPSAwOwogICAgICAgIH0KICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47ICsraSkgewogICAgICAgICAgICB0b3RhbCArPSB1W2ldOwogICAgICAgICAgICB1W2ldID0gMDsKICAgICAgICB9CiAgICB9CiAgICBjb3V0IDw8IHRvdGFsIC8gTiA8PCBlbmRsOwogICAgcmV0dXJuIDA7Cn0=