let count lst = 
  let is_digit x = "0" <= x && x <= "9" in
  let (x, y) = List.fold_left (fun (x, y) z -> if is_digit z then (10 * x + int_of_string z, y) else (0, x + y)) (0, 0) lst in
  x + y

let rec loop n =
  try
    let slst = Str.split (Str.regexp "") @@ read_line () in
    let x = count slst in
    loop (n + x)
  with
    End_of_file -> Printf.printf "%d\n" n

let _ = loop 0