s=gets ans=0 for i in 0...s.size j=i while j