Antiprime numbers

Time Limit:1000ms Memory Limit:64000KiB
Accepted:0 Submitted:0
Antiprime numbers

POI VIII Stage 1 Problem 3

Antiprime numbers

A positive integer n is an antiprime number, when it has more divisors than any positive integer, that is less than n.  These are examples of antiprime numbers: 1, 2, 4, 6, 12 and 24. 

Task

Write a program which:

  • reads from the text file ANT.IN a positive integer n,
  • finds the greatest antiprime integer not greater than n,
  • writes this number in the text file ANT.OUT.

Input

In the only line of the input file ANT.IN there is one integer n, 1 <= n <= 2 000 000 000. 

Output

In the only line of the output file ANT.OUT your program should write exactly one integer - the greatest antiprime number not greater than n.

Sample Input

1000

Sample Output

840
SubmitStatistics

SOJ is designed and developed by Wilbur Ding and Liang Sun. ©All Rights Reserved 2009-2012.