#include <iostream> int main(){ int n,ans = 1; std::cin >> n; for (int i = 2;i <= n;i++) ans ^= i; std::cout << ans << std::endl; return 0; }