c = gets cnt = 0 for i in 1..(c.length-2) if (c[i] != '0') cnt += 1 end end p cnt