let solve n = let rec inner m acc3 acc5 = if 3*m > n && 5*m > n then (acc3, acc5) else if 3*m > n then inner (m+1) acc3 (acc5 + 2) else if 5*m > n then inner (m+1) (acc3 + 2) acc5 else inner (m+1) (acc3 + 2) (acc5 + 2) in let x, y = inner 1 0 0 in print_int (x + y) let _ = let n = int_of_string @@ read_line() in solve n