CodeLab Academy 📞 9936 6696
← List Python · Level 8: Nested loops Code · 80 points ← #766 #768 →

#767. Twin primes

You are given n. Count the pairs where p and p+2 are both prime and p+2 ≤ n. ### Input One integer n (1 ≤ n ≤ 5000). ### Output A number.

Examples

Input
4342
Output
115
Input
4555
Output
119

💡 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!