aaa = input() ans = "" num = 0 for i in range(aaa): if (i+1)%3 == 0 and (i+1)%5 == 0: num = num + 4 elif (i+1)%3 == 0: num = num + 2 elif (i+3)%5 == 0: num = num + 2 print num