CodeLab Academy 📞 9936 6696
← List Python · Level 10: Algorithms Code · 100 points ← #914 #916 →

#915. Largest prime gap

You get n. Find the largest difference between two neighboring prime numbers that are not greater than n. ### Input One integer n (3 ≤ n ≤ 10⁶). ### Output A number.

Examples

Input
77664
Output
72
Input
676791
Output
114

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!