Snuke has prepared 6 problems for an upcoming programming contest. For each problem, Rng judges whether it can be used. Given a string S of length 6, where each character represents whether a problem is accepted (1) or not (0), determine the number of problems accepted for the contest. Constraints: S consists of 0s and 1s. Input is given as S. Output the number of accepted problems. Example: Input: 111100, Output: 4 (first four problems are accepted).

# Buggy version:
N = int(input())
ans = 0
for i in range(6):
  ans += N % 10
  ans //= 10

# Fixed version:
N = int(input())
ans = 0
for i in range(6):
  ans += N % 10
  N //= 10
print(ans)

# Buggy version:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    s=SI()
    ans=0
    for i in range(6):
        if s[i]==1:
            ans+=1
    print(ans)        
    

        
        
        
        
    
if __name__=="__main__":
    main()



# Fixed version:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    s=SI()
    ans=0
    for i in range(6):
        if s[i]=="1":
            ans+=1
    print(ans)        
    

        
        
        
        
    
if __name__=="__main__":
    main()

# Buggy version:
s=input()
num=0
for x in s:
  if x==1:
    num+=1
print(num)

# Fixed version:
s=input()
num=0
for x in s:
  if x=="1":
    num+=1
print(num)

# Buggy version:
s = list(input())

ans = 0

for ss in s:
    ans += int(s)
print(ans)

# Fixed version:
s = list(input())

ans = 0

for ss in s:
    ans += int(ss)
print(ans)

# Buggy version:
s=input()
ans = 0
for c in s:
  if c=="1"
    ans+=1
print(ans)

# Fixed version:
s = input()
ans = 0
for c in s:
    if c == '1':
        ans += 1
print(ans)

# Buggy version:
s=input()
ans=0
for_ in range(6):
  if s[_]=='1':
    ans+=1
print(ans)


# Fixed version:
s=input()
ans=0
for _ in range(6):
  if s[_]=='1':
    ans+=1
print(ans)

# Buggy version:
s=list(input())
ans=0
for i in s:
    if s=='1':
        ans+=1
print(ans)

# Fixed version:
s = list(input())
ans = 0
for i in s:
    if i == '1':
        ans += 1
print(ans)

# Buggy version:
    ans = 0
    for i in input():
        if i == '1':
            ans += 1
    print(ans)

# Fixed version:
S = input()
ans = 0
for i in S:
  if i == '1':
    ans += 1
print(ans)

# Buggy version:
s=input()
ans=0
for i in s:
  if i==1:
    ans+=1
print(ans)

# Fixed version:
s=input()
ans=0
for i in s:
	if(i=='1'):
		ans+=1

print(ans)

# Buggy version:
S = input()
count =  0
for i in S:
  if i == '1':
    count++
print(count)

# Fixed version:
S = input()
count = 0
for i in S:
 if i == '1':
  count += 1
print(count)

# Buggy version:
S = input()
ans = 0
for i in range(6):
  if S[i] == 1:
    ans += 1
print(ans)

# Fixed version:
S=input()
ans=0
for i in range(6):
    if S[i]=="1":
        ans+=1
print(ans)

# Buggy version:
S = int(input())

lst = []
while i > 0:
    lst.append(S%10)
    S //= 10 # 必須
lst.reverse()

print(sum(lst))
 

# Fixed version:
S = int(input())

lst = []
while S > 0:
    lst.append(S%10)
    S //= 10 # 必須
lst.reverse()

print(sum(lst))

# Buggy version:
s=input()
a=0
for i in range(6):
  if s[i]=="1":
    a+-1
print(a)

# Fixed version:
s = input()
a = 0
for i in range(6):
 if s[i] == "1":
  a += 1
print(a)

# Buggy version:
s=input()
ans=0
for i range 6:
  if int(s[i])==1:
    ans+=1
print(ans)

# Fixed version:
s=input()
ans=0
for i in range (6):
  if int(s[i])==1:
    ans+=1
print(ans)

# Buggy version:
a =input() 
c=0
for i in range(0,6):
 if a[i] == 1:
  c += 1
 else:
  pass
print(c)


# Fixed version:
a =input() 
c=0
for i in range(0,6):
    if a[i] == "1":
        c += 1
    else:
        pass
print(c)

# Buggy version:
s=input()
ans=0
for i in range(n):
    if s[i]=="1":
        ans+=1
print(ans)

# Fixed version:
s = input()
ans = 0
for i in range(len(s)):
    if(s[i] == '1'):
        ans += 1
print(ans)

# Buggy version:
inputs = input().split

print(inputs.count('1'))

# Fixed version:
inputs = input()

print(inputs.count('1'))

# Buggy version:
a = input()
ans = 0
for i in a:
    if a=='1':
        ans += 1

print(ans)

# Fixed version:
a = input()
ans = 0
for i in a:
    if i=='1':
        ans += 1
 
print(ans)

# Buggy version:
S = input()
ans = 0
for i in range(6):
  if S[i] == "1":
    ans += 1
print(i)

# Fixed version:
a = input()
ans = 0
for i in range(6):
    if a[i] == "1": ans += 1
print(ans)

# Buggy version:
s=input()
print(s.count("1")

# Fixed version:
s = list(input())
print(s.count("1"))

# Buggy version:
S = list(input())
print(S.count("1")

# Fixed version:
S = input()

print(S.count("1"))