while 1:print sum(map("06988".count,raw_input()))