cur = []
for c in range(0, 500,3):
    if (c % 2 != 0) and (c % 3 == 0):
        cur.append(c) 
soma = sum(cur)
print(soma)