num = int(input())
numbers = list(map(int, str(num)))
sum = 0
for i in numbers:
if i <= 4:
sum += i
print(sum)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
num = int(input())
numbers = list(map(int, str(num)))
sum = 0
for i in numbers:
if i <= 4:
sum += i
print(sum)