Imports System

Module Program
    Sub Main(args As String())
        Dim iInput As Integer = Console.ReadLine()
        Dim i As Integer
        Dim iSum As Integer = 0
        For i = 1 To iInput
            If (i Mod 3) = 0 And (i Mod 5) = 0 Then
            ElseIf (i Mod 5) = 0 Or (i Mod 3) = 0 Then
            Else
                iSum += i
            End If
        Next
        Console.WriteLine(iSum)
    End Sub
End Module
