#include <bits/stdc++.h> using namespace std; const int N=5e5+5; int main(){ long long k,jc=1,o=1; cin>>k; while(1){ o*=jc; if(o%k==0){ cout<<jc<<endl; break; } jc++; } return 0; }