Scanf.scanf "%d" (fun n -> let rec loop t g acc = if t * 5 > n then acc else if g > t || t * 5 + g * 2 > n then loop (t + 1) 0 acc else let acc = if (n - t * 5 - g * 2) mod 3 = 0 then acc + 1 else acc in loop t (g + 1) acc in loop 0 0 0 |> Printf.printf "%d\n" )