Problem:


Score : 100 points

Problem Statement

Snuke prepared 6 problems for a upcoming programming contest.
For each of those problems, Rng judged whether it can be used in the contest or not.

You are given a string S of length 6.
If the i-th character of s is 1, it means that the i-th problem prepared by Snuke is accepted to be used; 0 means that the problem is not accepted.

How many problems prepared by Snuke are accepted to be used in the contest?

Constraints

The length of S is 6.

S consists of 0 and 1.

Inputs

Input is given from Standard Input in the following format:

S

Outputs

Print the number of problems prepared by Snuke that are accepted to be used in the contest.

Sample Input 1

111100

Sample Output 1

4

The first, second, third and fourth problems are accepted, for a total of four.

Sample Input 2

001001

Sample Output 2

2

Sample Input 3

000000

Sample Output 3

0



Sample input:
111100


Sample output:
4

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")


def main():
    S = input()
    print(S.count("1"))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(str(input()))
ans=S.count('1')
print(ans)

Submission status: Accepted

Solution code:
N = raw_input()
print(N.count('1'))

Submission status: Accepted

Solution code:
from sys import stdin
print list(stdin.readline()).count('1')

Submission status: Accepted

Solution code:
s = input()

print(len(s.replace('0','')))

Submission status: Accepted

Solution code:
a = raw_input()
print(a.count('1'))

Submission status: Accepted

Solution code:
s = input()
count = 0
for i in range(6):
    if s[i] == "1":
        count += 1
print(count)

Submission status: Accepted

Solution code:
sum = 0
for x in raw_input():
    sum += int(x)
print sum

Submission status: Accepted

Solution code:
import sys
import socket
from collections import Counter

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    s = read_str()
    c = Counter(s)
    res = c['1']
    print(res)


main()

Submission status: Accepted

Solution code:
x = input()
a=x.count('1')
print(a)

Submission status: Accepted

Solution code:
def main():
    S = input()
    sum_= 0
    for i in range(len(S)):
        sum_ += int(S[i])
    print(sum_)

    
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python                                                                                           
#-*- coding: utf-8 -*-                                                                                          

if __name__ == "__main__":
    S = raw_input()
    num = 0
    for i in range(6):
        if int(S[i]) == 1:
            num += 1
    print num

Submission status: Accepted

Solution code:
N = raw_input()
print N.count("1")

Submission status: Accepted

Solution code:
import re
S = raw_input()
print len(re.findall("1",S))

Submission status: Accepted

Solution code:
a = input()
ans = 0
for i in a:
    if i == '1':
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
s = str(input())
char = list(s)
num = 0
for c in char:
    if int(c) == 1:
        num += 1

print(num)

Submission status: Accepted

Solution code:
print(len([i for i in input() if i == '1']))

Submission status: Accepted

Solution code:
n=raw_input()
ans=0
for i in range(6):
	if n[i]=='1':
		ans=ans+1
print ans

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    S = input()
    print(S.count('1'))

Submission status: Accepted

Solution code:
S = input()

count = 0

accept = list(map(int,str(S)))

for i in range(len(accept)):
    if accept[i] == 1:
        count += 1

print(count)

Submission status: Accepted

Solution code:
S = input()
count = 0
for x in S:
	if x == '1':
		count+=1
print(count)

Submission status: Accepted

Solution code:
s=input()

print(s.count('1'))

Submission status: Accepted

Solution code:
S = [int(n) for n in list(input())]
print(sum(S))

Submission status: Accepted

Solution code:
s = list(input())
s = map(int,s)
print(sum(s))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

str_input = input()
count = 0

for x in str_input:
    if x == '1':
        count += 1
print(count)

Submission status: Accepted

Solution code:
x = str(input())
ans = 0
for i in range(6):
    if x[i] == "1":
        ans = ans + 1
print(ans)

Submission status: Accepted

Solution code:

s = input()
count = s.count("1")
print(count)

Submission status: Accepted

Solution code:
print (input().count("1"))

Submission status: Accepted

Solution code:
import sys
import numpy as np

print(np.count_nonzero(list(map(int, list(sys.stdin.readline().strip())))))

Submission status: Accepted

Solution code:
S = int(input())
ans = 0
for i in range(6):
    A = S%10
    B = int(S/10)
    S = B
    ans += A
print(int(ans))

Submission status: Accepted

Solution code:
S =str(input())
a=S.count("1")
print(a)

Submission status: Accepted

Solution code:
s = str(input())
sl = list(s)
accepted = 0
for i in range(6):
    if sl[i] == "1":
        accepted += 1
print(accepted)

Submission status: Accepted

Solution code:
s = input()
print(s.count('1'))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    S = input()
    print(S.count("1"))

Submission status: Accepted

Solution code:
ans = 0

a = list(input())
for i in range(6):
    ans = ans + int(a[i])

print(ans)

Submission status: Accepted

Solution code:
a = input()
s = list(a)
n = len(a)
count = 0

for i in range(n) :
  count += int(s[i])

print (count)

Submission status: Accepted

Solution code:
#!user/bin/env python
# coding:utf-8

s = input()
c = 0
for a in s:
    if a == '1':
        c += 1

print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
con = input()
print(con.count("1"))

Submission status: Accepted

Solution code:
N = input()
list(N)
print(N.count("1"))

Submission status: Accepted

Solution code:
#coding: utf-8
string = input()
print(len(list(filter(lambda x: x == '1', list(string)))))

Submission status: Accepted

Solution code:
s=raw_input()
c=0
for i in range(6):
	if s[i]==str(1):
		c+=1
print c

Submission status: Accepted

Solution code:
"""入力に長さ6の文字列，出力は文字列の中の1の数"""

def main():
    """実行部"""
    decision_string = input()
    counter = 0
    for each_sentence in decision_string:
        if each_sentence == "1":
            counter += 1
    print(counter)
    return None

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 文字列の入力
c = input().count('1')
# 1の出現回数の出力
print(c)

Submission status: Accepted

Solution code:
s=input()

ans=s.count("1")

print(ans)

Submission status: Accepted

Solution code:
a=input()
e=[a[i] for i in range(len(a))]
b=sum(list(map(int,e)))
print(b)

Submission status: Accepted

Solution code:
S = [int(i) for i in input()]
print(sum(S))

Submission status: Accepted

Solution code:
str = input()

count = 0

for letter in str:
    count += int(letter)

print(count)

Submission status: Accepted

Solution code:
S = str(input())
a = 0
for i in range(6):
    if S[i] == "1":
        a += 1
print(a)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

S = input()
num = 0
for i in range(6):
    num += int(S[i])

print(num)

Submission status: Accepted

Solution code:
S = input()
cnt = 0
for s in S:
    if s =="1":
        cnt +=1

print(cnt)

Submission status: Accepted

Solution code:
nyuryoku = input()

print(nyuryoku.count("1"))

Submission status: Accepted

Solution code:
inputs = input()

print(inputs.count('1'))

Submission status: Accepted

Solution code:
def main():
    S = input()
    print(S.count('1'))

main()

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()

numList = list(S)

count = 0
for i in numList:
	if i == "1":
		count += 1

print(count)

Submission status: Accepted

Solution code:
inp=raw_input()
print int(inp[0])+int(inp[1])+int(inp[2])+int(inp[3])+int(inp[4])+int(inp[5])

Submission status: Accepted

Solution code:
#!usr/bim/python
#! -*- coding: utf-8 -*-

n = raw_input()

count = 0
for i in range(6):
    if n[i] == "1":
        count += 1

print count

Submission status: Accepted

Solution code:
inp = list(input())
ans = 0
for a in inp:
    if a == "1":
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
a = raw_input()
print(a.count('1'))

Submission status: Accepted

Solution code:
S = input()

ans = 0
for i in range(6):
    if S[i]=='1':
        ans += 1
    else:
        continue

print(ans)

Submission status: Accepted

Solution code:
S = raw_input()
ac = 0
for i in S:
    if i == '1':
        ac += 1

print ac

Submission status: Accepted

Solution code:
def solution():
	return sum([int(x) for x in list(input())])


print(solution())

Submission status: Accepted

Solution code:
a = list(input())
print(a.count("1"))

Submission status: Accepted

Solution code:
S = input()
ans = 0
for s in S:
    ans += int(s)
print(ans)

Submission status: Accepted

Solution code:
a = input()
ans = 0
for i in a:
    if i=='1':
        ans += 1
 
print(ans)

Submission status: Accepted

Solution code:
n = input()

ac  = 0
for i in n:
    if i == '1':
        ac += 1
        
print(ac)

Submission status: Accepted

Solution code:
#! -*- coding:utf-8 -*-
s = list(input())

x = 0
for i in range(len(s)):
    k = int(s[i])
    if k == 1:
        x += 1

print(x)

Submission status: Accepted

Solution code:

N = str(input())
count=0

for i in N:
    if i=='1':
        count +=1

print(count)

Submission status: Accepted

Solution code:
S = list(input())
res = 0
for i in range(6):
  if S[i] == '1':
    res += 1
print(res)

Submission status: Accepted

Solution code:
def main():
    value = input()
    list_value = list(value)
    print(list_value.count("1"))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
i=input()
print(i.count('1'))

Submission status: Accepted

Solution code:
s = input()
count = 0
for e in s:
  if e == '1':
    count += 1
print(count)

Submission status: Accepted

Solution code:
s = input()
n = 0
for c in s:
    if c == '1':
        n += 1
print(n)

Submission status: Accepted

Solution code:
s = input()
sum = 0
for i in s:
    if i == '1':
        sum = sum + 1
print(sum)

Submission status: Accepted

Solution code:
s = str(input())

print(s.count('1'))

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

S = input()

ans = 0
for c in S:
    if c=='1':
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://tenka1-2017-beginner.contest.atcoder.jp/tasks/tenka1_2017_a

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    S = input().strip('\n')
    print(S.count('1'))


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
S=input()

print(S.count("1"))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

rst = 0
for i in range(len(s)) : 
    t = s[i]
    if t == "1" : rst += 1

print(rst)

Submission status: Accepted

Solution code:
s = list(input())
print(s.count("1"))

Submission status: Accepted

Solution code:
S = input()

print(S.count("1"))

Submission status: Accepted

Solution code:
s = raw_input()
ans = 0
for i in s:
  if(i == "1"):
    ans+=1
print ans

Submission status: Accepted

Solution code:
S = input()
from collections import Counter as c
print(c(S)['1'])

Submission status: Accepted

Solution code:
S = input()
ans = 0

for a in S:
    if a == "1":
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

S = raw_input()

print S.count("1")

Submission status: Runtime Error

Solution code:
a,s,d,f,g,h= map(int, input().split())

print(a+s+d+f+g+h)

Submission status: Runtime Error

Solution code:
n=list(int,input())
count=0
for i in range(n):
  if n=='1':
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
print(list(input()).count('1'))	]

Submission status: Runtime Error

Solution code:
s=input()
ans = 0
for c in s:
  if c=="1"
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
s = list(int(input()))
print(s.count(1))

Submission status: Runtime Error

Solution code:
s=input()
print(s.count("1")

Submission status: Runtime Error

Solution code:
S = input()
count =  0
for i in S:
  if i == '1':
    count++
print(count)

Submission status: Runtime Error

Solution code:
print (input().count(1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(sum(int(input())))

Submission status: Runtime Error

Solution code:
s = list(input())

ans = 0

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

Submission status: Runtime Error

Solution code:
def main():
  n = int(input())
  a = [[]]*n
  for i in range(n):
    a[i] = list(map(int, input().split()))

  a.sort()
  print(a[-1][0]+a[-1][1])

main()

Submission status: Runtime Error

Solution code:
n = input()
return n.count('1');

Submission status: Runtime Error

Solution code:
print(sum(list(input())))

Submission status: Runtime Error

Solution code:
print(list(input).count(1))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
ans=0
for_ in range(6):
  if s[_]==1:
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
print(l)
count = 0
for i in l:
    if i == 1:
        count = count + 1
print(count)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
from copy import deepcopy
from math import log
N,K=map(int,input().split())
AB=[0]*N
dic=defaultdict(int)
#n=int(ceil(log(K,2)))+1
for i in range(N):
    a,b=map(int,input().split())
    if a in dic.keys():
        AB[dic[a]]=[a,AB[dic[a]][1]+b]
    else:
        dic[a]=i
        AB[i]=[a,b]
ans=sum([b for a,b in AB if K|a==K])
print(bin(K))
for i in range(int.bit_length(K)-1,0,-1):
    if not K &(1<<i):
        continue
    m=K & ~(1<<i)|(1<<i)-1
    print(bin(m))
    s=sum([b for a,b in AB if m | a ==m])
    ans=max(s,ans)
print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())
print(a.count(1))

Submission status: Runtime Error

Solution code:
S = input()

print(S.count(1))

Submission status: Runtime Error

Solution code:
print(input().scount("1"))

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0
while ans == 0: 
	for h in range(3500):
		h = h + 1
		for n in range(3500):
			n = n + 1
			up = 4*h*n - n*N - N*h
			down = N*h*n
			if up  0:
				if down % up == 0:
					w = down // up
					ans = 1
					break
		if ans == 1:
			break
print(h, n , w)

Submission status: Runtime Error

Solution code:
    ans = 0
    for i in input():
        if i == '1':
            ans += 1
    print(ans)

Submission status: Runtime Error

Solution code:
S = int(input())

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

print(sum(lst))

Submission status: Runtime Error

Solution code:
l = list(input())
a = [int(x) for x in l]
prtint(sum(a))

Submission status: Runtime Error

Solution code:
s=input()
count=0
for i in range(s.length):
  if s[i]==1:
    count+=1

print(count)

Submission status: Runtime Error

Solution code:
a=int(input())
ans=0
for i in a:
  ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
ans=0
for i range (6):
  if int(s[i])==1:
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
ans=0
for i range 6:
  if int(s[i])==1:
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
print(sum([int(list(input())[i]) for i in range(6)]))

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    max_a, max_b = 0, 0 # type:int
    for _ in range(n):
        a, b = input().split(' ')
        a = int(a)
        if max_a < a:
            max_a = a
            max_b = int(b)
    print(max_a + max_b)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    N = input()

    for n in range(1,3501):
        for h in range(1,3501):
            w = n * h * N / (4 * n * h - N * n - N * h)
            if isinstance(w, int) and w > 0:
                break

    print w, h, n

Submission status: Runtime Error

Solution code:
N = input()
N = float(N)
result = 4/N
 
def output2():
    for i in range(3500):
        for j in range(3500):
            h = float(i+1)
            n = float(j+1)
            
            sum_ = 1/h + 1/n
            
            sum2 = result - sum_
            
            if(sum2 <= 0):
                continue
            
            w =  1/sum2
            
            if(w == int(w)):
                return('{} {} {}'.format(int(h),int(n),int(w)))
 
print(output2())

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
from fractions import Fraction as F
N = int(input())
left = F(4, N)
for i in range(1, 3500):
    if(left > F(1, i)):
        h = i
        break
for i in range(1, 3500):
    if(left > F(1, h) + F(1, i)):
        n = i
        break
for i in range(1, 3500):
    if(left == F(1, h) + F(1, n) + F(1, i)):
        w = i
        break
print(h, n, w)

Submission status: Runtime Error

Solution code:
from fractions import F
N = int(input())
left = F(4, N)
for i in range(1, 3500):
    if(left > F(1, i)):
        h = i
        break
for i in range(1, 3500):
    if(left > F(1, h) + F(1, i)):
        n = i
        break
for i in range(1, 3500):
    if(left > F(1, h) + F(1, n) + F(1, i)):
        w = i
        break
print(h, n, w)

Submission status: Runtime Error

Solution code:
n = int(input())
a_b = [input() for i in range(n)]
min = 1000000001
max = -1
max_point = 0
for i in a_b:
    a, b = map(int, i.split())
    if(min > a):
        min = a
    if(max < a):
        max = a
        max_point = b

num = 0
num += min
num += max - min
num += max_point

print(num)

Submission status: Runtime Error

Solution code:
s = input()
count = 0
for x in s:
    if x == "1" 
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
# h,n,w
temp = int((3*N)/4)
hlist = [i+1 for i in range(temp)]
flag = False
for i in hlist:
    temp = 4/N - 1/i
    if(temp > 0):
        nlist = [i+1 for i in range(int(2/temp))]
        for j in nlist:
            beta = 4/N - 1/i - 1/j
            if (beta > 0):
                if(1/beta == int(1/beta)):
                    w = int(1/beta)
                    n = j
                    h = i
                    flag = True
                    break

    if flag:
        break

print(str(h)+ " " + str(n)+ " " +str(w))

Submission status: Runtime Error

Solution code:
print(input().conut('1'))

Submission status: Runtime Error

Solution code:
N = int(input())
A = []
B = []
for n in range(N):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)
print(max(A) + min(B))

Submission status: Runtime Error

Solution code:
s=input()
print (s.count(1))

Submission status: Runtime Error

Solution code:
 s = input()
print(s.count("1"))

Submission status: Runtime Error

Solution code:
S = input()
print(S.count(1))

Submission status: Runtime Error

Solution code:
S = list(input())
print(S.count("1")

Submission status: Runtime Error

Solution code:
inputs = input().split

print(inputs.count('1'))