let f x = if x < 40 then 40 else x;;

let () =
  let n1 = read_int () |> f and
      n2 = read_int () |> f and
      n3 = read_int () |> f and
      n4 = read_int () |> f and
      n5 = read_int () |> f in
  Printf.printf "%d\n" ((n1+n2+n3+n4+n5)/5)
;;