let rec seq l n flg = function
    i when i = 11 -> l
  | i -> let m = if flg then n*.2. else n/.3.
         in seq (n::l) m (not flg) (i+1);;

let rec read () =
  try let num = read_float () in
      print_float (List.fold_left (+.) 0. (seq [] num true 1));print_newline ();read ()
  with End_of_file -> ();;

let () = read ();;