eolymp
bolt
Try our new interface for solving problems

Salut!

Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB

That day finally came! With ultimate joy and happiness! Today, Mr.Mammadov has a wedding and, of course, his all friends, including Barish, Murad, Ziya, Rafael,Huseyn,Mahammad, and Mahmud, are drinking to his honor! But there is special condition: they want it to be a number-theoric cheering, so they count numbers starting from one, and when the number is divisible by 3 or 5, they drink and say “Salut!”, skipping that number. This is how they will count and drink:1, 2, Salut!, 4, Salut!, Salut!, 7, 8, Salut!,Salut!, 11, Salut!,... Mr.Mammadov saw his friends like this and remembered good old days, when he was the absolute god of competitive programming (now he is a legend). Recalling these days, he wanted to know what would be the N’th number his friends will say.For example, the 3’rd number is 4, and the 5’th number is 8 (as the sequence is like (1, 2, 4, 7 , 8, ...) ). Now he is busy with taking cliché wedding pictures, so you need to solve this problem for him.

####Input format:The number N (1 ≤ N10^12 ) is given in the first and the last line.

####Output format:The N’th number said during the drinking phase.

Nümunə

Giriş verilənləri #1
3
Çıxış verilənləri #1
4
Giriş verilənləri #2
5
Çıxış verilənləri #2
8
Mənbə IZHO 2019-2020 Azerbaijan selection contest