fn main(){for io::stdin().each_line|l|{println(fmt!("%.6f",(l.to_bytes().count(&l[0])-1)as float/(l.len()as float-2.)))}}