#define _CRT_SECURE_NO_WARNINGS #include #include #include int main(void) { int i; int s, d; int num[10] = { 0 }; int sum = 1; scanf("%d", &s); while (s != 0) { d = s % 10; switch (d) { case 0: num[0]++; break; case 1: num[1]++; break; case 2: num[2]++; break; case 3: num[3]++; break; case 4: num[4]++; break; case 5: num[5]++; break; case 6: num[6]++; break; case 7: num[7]++; break; case 8: num[8]++; break; case 9: num[9]++; break; } s = s / 10; } for (i = 0; i < 10; i++) { sum += num[i] * 2; } sum += num[0]; sum += num[4]; sum += num[6]; sum += num[9]; sum += num[8] * 2; printf("%d\n", sum); return 0; }