using System;
public class Program
{
public static void Main()
int s=0, i;
for(i=1; i<=17; i++)
if((i % 3 == 0) || (i%5 == 0))
s = s + i;
}
Console.WriteLine("{0}", s);