n = int(input()) both_devidable = n // 15 three_devidable = n // 3 five_devidable = n // 5 result = both_devidable * 4 + (three_devidable + five_devidable - 2* both_devidable) * 2 print(result)