N = int(input()) fif = N//15 three = N//3-fif five = N//5-fif print((three+five)*2+fif*4)