use std::io; use std::io::prelude::*; fn main() { let stdin = io::stdin(); let answer = string_length_sum(stdin.lock().lines().map(|l| l.unwrap())); dbg!(answer); } fn string_length_sum(it: impl Iterator) -> usize { it.map(|l| l.len()).sum() }