open System

let fizzbuzz n: uint64 =
    if n % 3 <> 0 && n % 5 <> 0 then uint64 n else uint64 0

[<EntryPoint>]
let main argv =
    seq { for i in 1 .. Console.ReadLine() |> int -> fizzbuzz i}
    |> Seq.sum
    |> printfn "%d"
    0
