N = input() d = {'0':3,'1':2,'2':2,'3':2,'4':3,'5':2,'6':3,'7':2,'8':4,'9':3} ans = 1 for i in N: ans += d[i] print(ans)