N = int(eval(input()))

sum = 0



for i in range(N):

    if (i + 1) % 3 != 0 and (i + 1) % 5 != 0:

        sum += (i + 1)



print(sum)
N = int(eval(input()))



def isnot_fizzbuzz(number: int) -> bool:

    if (number) % 3 != 0 and (number) % 5 != 0:

        return True

    return False



def main():

    sum = 0

    for number in range(1, N + 1):

        if isnot_fizzbuzz(number) == True:

            sum += number

    print(sum)



if __name__ == "__main__":

    main()
N = int(eval(input()))
sum = 0
for i in range(N):
    if (i + 1) % 3 != 0 and (i + 1) % 5 != 0:
        sum += i + 1
print(sum)

N = int(eval(input()))


def isnot_fizzbuzz(number: int) -> bool:
    if (number) % 3 != 0 and (number) % 5 != 0:
        return True
    return False


def main():
    sum = 0
    for number in range(1, N + 1):
        if isnot_fizzbuzz(number) == True:
            sum += number
    print(sum)


if __name__ == "__main__":
    main()

-sum = 0 -for i in range(N): -    if (i + 1) % 3 != 0 and (i + 1) % 5 != 0: -        sum += i + 1 -print(sum) + + +def isnot_fizzbuzz(number: int) -> bool: +    if (number) % 3 != 0 and (number) % 5 != 0: +        return True +    return False + + +def main(): +    sum = 0 +    for number in range(1, N + 1): +        if isnot_fizzbuzz(number) == True: +            sum += number +    print(sum) + + +if __name__ == "__main__": +    main()