const counts = [1,0,0,0,1, 0,1,0,2,1] proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} var cnt = 0 var num = 0 while true: var k = getchar_unlocked() if k < '0' or k > '9': break cnt += counts[k.ord - '0'.ord] num += 1 echo num + 1 + cnt + num