#include void solve() { int n; std::cin >> n; std::cout << "428571"[n % 6] << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }