#include int main(void){ int N,i; scanf("%d",&N); for(i=N-100;i<=N+100;i++){ if(i%2==0&&i!=2){ printf("%d\n",i);break; } } return 0; }