N=int(input ()) if N+90%2==0: print (N+90) else: print (N+91) # ''' i=N-100 e=0 while i<=N+100 and e==0: j=2 while e==0: if i%j==0: print (i) e=1 j+=1 i+=1 '''