#include <iostream> using namespace std; int main() { int n; cin>>n; if(n==1||n==2){ cout<<-1; return 0; } if(n%2==1){ cout<<2; } else{ if(n%4==0){ cout<<3; } else{ cout...