Problem:


Score : 100 points

Problem Statement

You are given an integer N that has exactly four digits in base ten.
How many times does 2 occur in the base-ten representation of N?

Constraints

1000 \leq N \leq 9999

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

1222

Sample Output 1

3

2 occurs three times in 1222. By the way, this contest is held on December 22 (JST).

Sample Input 2

3456

Sample Output 2

0

Sample Input 3

9592

Sample Output 3

1



Sample input:
1222


Sample output:
3

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
cnt = 0
for i in range(len(N)):
    if int(N[i]) == 2:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
k = 0
while n:
  if n % 10 == 2:
    k += 1
  n //= 10
print(k)

Submission status: Accepted

Solution code:
A = list(input())
print(A.count("2"))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

result = str(N).count("2")
print(result)

Submission status: Accepted

Solution code:
count = 0
N = input()
for i in N:
    if int(i) == 2:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n = (input())
print(n.count('2'))

Submission status: Accepted

Solution code:
N = input()
a = N.count("2")
if a > 0:
	print(a)
else:
	print(0)

Submission status: Accepted

Solution code:
N = int(input())
count = 0
for i in range(N):
    if N==0:
        break
    if N%10 == 2:
        count += 1
    N //= 10

print(count)

Submission status: Accepted

Solution code:
def count_of_2(N):
    count = 0
    for i in list(N):
        if i == '2':
            count += 1

    return count


print(count_of_2(input()))

Submission status: Accepted

Solution code:
N = list(input())

print(len([elm for elm in N if elm == "2"]))

Submission status: Accepted

Solution code:
count=0
n=int(input())

for i in range(4):
    if n%10 == 2:
        count = count+1
    n = int(n/10)
        
print(count)

Submission status: Accepted

Solution code:
import io

str_in = list(input())
count = 0

for i in range(4):
    if str_in[i] == '2':
        count+=1

print(count)

Submission status: Accepted

Solution code:
n=input()
count = 0
for i in n:
    if i == "2":
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

cnt = 0
for s in n:
    if s == "2":
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
# _*_ coding:utf-8 _*_
#  CADDi2018 for Beginners A 1222
#  https://atcoder.jp/contests/caddi2018b/tasks/caddi2018b_a

def  counter2(forSizeInteger):
	forSizeString = str(forSizeInteger)
	counter = 0
	if(forSizeString[0]=='2'):
		counter = counter + 1
	if (forSizeString[1] == '2'):
		counter = counter + 1
	if (forSizeString[2] == '2'):
		counter = counter + 1
	if (forSizeString[3] == '2'):
		counter = counter + 1

	answer=counter

	return answer


if __name__ == '__main__':
	n = int(input())
	solution=counter2(n)
	print(solution)

Submission status: Accepted

Solution code:
def main():
    print(input().count("2"))
main()

Submission status: Accepted

Solution code:
A = str(input())
print(list(A).count('2'))

Submission status: Accepted

Solution code:
import sys

line = sys.stdin.readline().replace('\n', '')

cnt = 0
for i in line:
  if i == '2':
    cnt += 1

print (cnt)

Submission status: Accepted

Solution code:
def main(n):
  s=0
  if n%10==2:
    s+=1
  if (n%100)//10==2:
    s+=1
  if (n%1000)//100==2:
    s+=1
  if n>=2000 and n<=2999:
    s+=1
  return s
n=int(input())
print(main(n))

Submission status: Accepted

Solution code:
p = input()

i = 0
q = 0

while i < 4:
    if p[i] == "2":
        q+=1
    i+=1
print(q)

Submission status: Accepted

Solution code:
N = list(input())

count = 0
for i in N:
    if i == "2":
        count += 1
        
print(count)

Submission status: Accepted

Solution code:
n = input()
print(sum([1 if i == '2' else 0 for i in n]))

Submission status: Accepted

Solution code:
N = list(str(input()))
ans = 0
for i in range(4):
    if N[i] == '2':
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
li = []
while n > 0:
    li.append(n%10)
    n //= 10
li.reverse()
ans = 0
for i in range(len(li)):
    if li[i] == 2:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a,b,c,d = map(int,input())

if a==2:
  e=1
else:
    e=0
    
if b==2:
  f=1
else:
    f=0
  
if c==2:
  g=1
else:
    g=0
    
if d==2:
  h=1
else:
    h=0
  
print(e+f+g+h)

Submission status: Accepted

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

N = input()
print(N.count('2'))

Submission status: Accepted

Solution code:
n = int(input())
lst = []
while n > 0:
    lst.append(n % 10)
    n //= 10
print(lst.count(2))

Submission status: Accepted

Solution code:
a = input()
a = str(a)
b = 0
for i in range(len(a)):
    if a[i]=="2":
        b=b+1
    else:
        b=b
print(b)

Submission status: Accepted

Solution code:
n = int(input())
i = 0
flag = 0
m = [0,0,0,0]

m[0] = n // 1000
m[1] = n // 100 - m[0] * 10
m[2] = n // 10 - m[0] * 100 -  m[1] * 10
m[3] = n - m[0] * 1000 - m[1] * 100 - m[2] * 10

while i <= 3:
    if m[i] == 2 :
        flag = flag + 1
    i = i + 1
print(flag)

Submission status: Accepted

Solution code:
N=raw_input()

cnt=0
for x in N:
	if x=="2":cnt+=1

print cnt

Submission status: Accepted

Solution code:
S = input()
ans = []
count = 0
for i in range(len(S)):
    if int(S[i]) == 2:
        count += 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(4):
 a = N%10
 if a==2:
  ans = ans+ 1
 N /= 10
 N = int(N)
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
N = stdin.readline().rstrip()

N=str(N)
o=0
if len(N)==4:
    if N[0]=="2": o+=1
    if N[1]=="2": o+=1  
    if N[2]=="2": o+=1  
    if N[3]=="2": o+=1  

print(o)

Submission status: Accepted

Solution code:
n=input()
c=0
for k in n:
    if k=="2":
        c+=1
print(c)

Submission status: Accepted

Solution code:
num = []
n = int(input())
while n != 0:
  num.append(n % 10)
  n //= 10
num.reverse()

count = 0

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

print(count)

Submission status: Accepted

Solution code:
x = input()
print(str(x).count("2"), flush=True)

Submission status: Accepted

Solution code:
a = int(input())
count = 0
lst = []
while a > 0:
  lst.append(a%10)
  a //= 10
lst.reverse()
for i in lst:
  if i == 2:
    count = count + 1
print(count)

Submission status: Accepted

Solution code:
N = str(input())
print(N.count(('2')))

Submission status: Accepted

Solution code:
N = str(input())
count = 0

for i in N:
  if i=="2":
     count += 1

print(count)

Submission status: Accepted

Solution code:
x = input()
cnt = 0
for i in range(4):
    cnt += 1 if x[i]=='2' else 0
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
N = str(input())
print(N.count('2'))

Submission status: Accepted

Solution code:
N = input()

count = N.count('2')

print(count)

Submission status: Accepted

Solution code:
text = input()
cnt = 0
for i in text:
	if i == "2":
		cnt += 1
print (cnt)

Submission status: Accepted

Solution code:
li = list(input())
sum = 0
for i in range(len(li)):
    if li[i] == "2":
        sum += 1
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def read():
    buf = input()
    return buf


def solve(N):
    count = 0
    for letter in N:
        if letter is '2':
            count += 1

    return count


if __name__ == '__main__':
    inputs = read()
    print(solve(inputs))

Submission status: Accepted

Solution code:
n = input()
n1 = len(n)
count = 0
for i in range(n1):
    if n[i] == '2':
        count += 1
print(count)

Submission status: Accepted

Solution code:
N = input()
cnt = 0
for i in range(4):
    if int(N[i]) == 2:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
bobo = input()
a=bobo.count('2')
print(a)

Submission status: Accepted

Solution code:
N = input()
count = 0
for n in N:
    if n == "2":
        count += 1
print(count)

Submission status: Accepted

Solution code:
N = str(input())

count = 0

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

print(count)

Submission status: Accepted

Solution code:
i = list(input())
s = 0
k = 0

while k <= 3:
    if i[k] == "2":
        s += 1
    k += 1
print (s)

Submission status: Accepted

Solution code:
s=int(input())
c=0
if s - int(s/10)*10 ==2:
    c=c+1
s=int(int(s/10))
if s - int(s/10)*10 ==2:
    c=c+1
s=int(int(s/10))
if s - int(s/10)*10 ==2:
    c=c+1
s=int(int(s/10))
if s - int(s/10)*10 ==2:
    c=c+1
s=int(int(s/10))

print(c)

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools
# ひとつ入力
n = int(input())
answer = 0
while n>0:
    if n%10==2:
        answer += 1
    n = n // 10
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

s = input()
res = 0

for i in s:
	if i =='2':
		res +=1
		
print(res)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
t = list(input())
b = [int(s) for s in t]
print(b.count(2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=input()

seek=0

for i in range(4):
    a=int(N[i:i+1])
    if a==2:
        seek+=1

print(seek)

Submission status: Accepted

Solution code:
N = input()

count = 0

for s in N:
    if s == '2':
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = input().strip()
num=0

for i in range(len(N)):
    if N[i] == '2':
        num += 1
        
print(num)

Submission status: Accepted

Solution code:
N=str(input())
print(N.count("2"))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
lst = []
while N > 0:
    lst.append(N%10)
    N //= 10 # 必須
lst.reverse()
print(lst.count(2))

Submission status: Accepted

Solution code:
n=int(input())
ans=0
if n%10==2:
    ans+=1
if ((n-n%10)/10)%10==2:
    ans+=1
if ((n-n%100)/100)%10==2:
    ans+=1
if (n-n%1000)/1000==2:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

cnt = 0

N4 = int(N /1000)

N = N - N4 * 1000

N3 = int(N /100)


N = N - N3 * 100

N2 = int(N /10)

N = N - N2 * 10
     

if N == 2:
    cnt =cnt + 1

if N4 == 2:
    cnt =cnt + 1

if N3 == 2:
    cnt =cnt + 1

if N2 == 2:
    cnt =cnt + 1

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

def digitSum(s):
    count = 0
    x1 = s//10**4
    x2 = (s-x1*10**4)//10**3
    x3 = (s-x2*10**3-x1*10**4)//10**2
    x4 = (s-x3*10**2-x2*10**3-x1*10**4)//10
    x5 = (s-x4*10-x3*10**2-x2*10**3-x1*10**4)

    if x2==2:
        count+=1
    if x3==2:
        count+=1
    if x4==2:
        count+=1
    if x5==2:
        count+=1

    return count
    


print(digitSum(N))

Submission status: Accepted

Solution code:
n = int(input())
n1000 = n//1000
na = n-1000*n1000
n100 = na//100
nb=na-100*n100
n10=nb//10
nc=nb-10*n10
c = 0
if n1000 ==2:
    c += 1
if n100 ==2:
    c += 1
if n10 ==2:
    c+=1
if nc ==2:
    c+=1
print(c)

Submission status: Accepted

Solution code:
n =list(str(input())) 
count = 0
for s in n:
  if s == '2':
    count+=1
print(count)

Submission status: Accepted

Solution code:
number_str = input()
count = 0
for c in number_str:
    if c == '2':
        count += 1

print(count)

Submission status: Accepted

Solution code:
a=list((input()))
count=0
for i in range(len(a)):
    if int(a[i])==2:
        count+=1
print(count)

Submission status: Accepted

Solution code:
N = raw_input()
print len([i for i in N if i == '2'])

Submission status: Accepted

Solution code:
N = map(str,input())
M = [M for M in N]
print(M.count("2"))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = input()

print(data.count('2'))

Submission status: Accepted

Solution code:
num = input()

print(num.count("2"))

Submission status: Accepted

Solution code:

N = input()


print(N.count("2"))

Submission status: Accepted

Solution code:
N = str(input())


print(N.count("2"))

Submission status: Accepted

Solution code:
#coding:utf-8

N = str(input())

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

print(count)

Submission status: Accepted

Solution code:
n=input()
ans=0
ans=n.count('2')
print(ans)

Submission status: Accepted

Solution code:
N = str(input())

num = 0
ln = len(N)
for nn in range(ln):
    if N[nn] == "2":
        num = num + 1
print(num)

Submission status: Accepted

Solution code:
N = str(input())
cnt = 0
for c in N:
    if c=='2':
        cnt += 1
print(cnt)

Submission status: Accepted

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

from sys import stdin

def load():
    n = stdin.readline()
    return n

def calc(n):
    return n.count("2")

n = load()
print(calc(n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
count = 0

for c in s:
    if c == '2':
        count += 1
print(count)

Submission status: Accepted

Solution code:
a = int(input())
b = str(a)
print(b.count("2"))

Submission status: Accepted

Solution code:
N = input()
a = 0
for i in N:
    if i == "2":
        a += 1
print(a)

Submission status: Accepted

Solution code:
n = list(str(input()))

ans = 0

for i in range(len(n)):
    if n[i] == '2':
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = input()
n = list(N)
cnt = 0
for s in n:
    if s == "2":
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#encoding:utf-8

n = list(input())

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


print(count)

Submission status: Accepted

Solution code:
N = input()
cnt = 0
for n in N:
    if n == '2':
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
N = input()
ans_list = [x for x in N if x == '2']
print(len(ans_list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())

n_1000 = N // 1000
n_100 = (N - n_1000*1000) // 100
n_10 = (N - n_1000*1000 - n_100*100) // 10
n_1 = (N - n_1000*1000 - n_100*100 - n_10*10)

cnt = 0
if n_1000 == 2:
    cnt += 1
if n_100 == 2:
    cnt += 1
if n_10 == 2:
    cnt += 1
if n_1 == 2:
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N=input()

print(N.count('2'))

Submission status: Accepted

Solution code:
n=input()
count=0

for k in n:
    if k== "2":
        count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

cnt = 0
for n in N:
    if n == "2":
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = 0

for i in range(len(s)):
    if s[i] == '2':
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=input()

ans=0
for i in range(len(n)):
  if n[i]=="2":
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
cs = list(input())
ans = len(list(filter(lambda c: c == '2', cs)))
print(ans)

Submission status: Accepted

Solution code:
N = input()
cnt = 0
for i in range(4):
    tmp = N[i]
    if tmp == "2":
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = str(input())

ans = 0
for i in range(0, 4):
    if N[i] == '2':
        ans = ans + 1
        
print(ans)

Submission status: Accepted

Solution code:
n = str(input())
c = 0
for i in range(4):
 if n[i] == "2":
  c += 1
print(c)

Submission status: Accepted

Solution code:
N = input()
Sum = 0

for Str in N:
	#print(Str)
	if(Str == "2"):
		Sum += 1

print(Sum)

Submission status: Accepted

Solution code:

i = list(input())

n = 0
for x in i:
	if x == '2':
		n += 1

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N  = input()
print(N.count('2'))

Submission status: Accepted

Solution code:
n = int(input())

count = 0
while n > 0 :
    if n % 10 == 2:
        count+=1
    n = n // 10

print(count)

Submission status: Accepted

Solution code:
N = str(input())
n = 0
for i in range(len(N)):
  if N[i] == "2":
    n += 1

print(n)

Submission status: Accepted

Solution code:
print(len([c for c in input() if c =='2']))

Submission status: Accepted

Solution code:
N = input();

print(N.count('2'))

Submission status: Accepted

Solution code:
n = input()

#%%


#%%
print(n.count("2"))

Submission status: Accepted

Solution code:
N = input()
Nlis = list(N)
a = 0
for i in range(4):
    if int(Nlis[i])==2:
        a = a+1
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

print(N.count("2"))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 15 22:14:32 2018

@author: doppe
"""
a = input()

count = 0
for c in a:
    if c == '2':
        count += 1

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = input()
print(N.count('2'))

Submission status: Accepted

Solution code:
#!/mnt/c/Users/moiki/bash/env/bin/python
x = (input())
cnt = 0
for c in x:
    if c == "2":
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
N=input()

sum=0
for i in range(4):
    sum+=1 if N[i]=='2' else 0

print(sum)

Submission status: Accepted

Solution code:

import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [(input_raw[0])]
    count = 0
    for s in N:
        if s == "2":
            count += 1

    print count

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
S = list(input())
print(S.count("2"))

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

while N>0:
    tmp = N%10
    N = (N-tmp)//10
    if tmp == 2:
        ans = ans+1
        

print(ans)

Submission status: Accepted

Solution code:
n=(input())
cnt=0
for i in range(4):
    if n[i]=='2':
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N = input().strip().split()

Nstr = str(N)

count = 0
for i in range(0, len(Nstr)):
    if Nstr[i] == '2':
        count = count+1
print(count)

Submission status: Accepted

Solution code:
N = input()
ans = 0

for i in N:
    if i == "2":
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=input()
l=len(n)
sum=0
for i in range(l):
  if n[i]=='2':
    sum+=1
print(sum)

Submission status: Accepted

Solution code:
# 2018/12/22
# CADDi2018 for Beginners A

# Input
n = input()

# Init
cnt = 0

# Search
for idx in range(4):
    if int(n[idx]) == 2:
        cnt += 1
        
# Output
print(cnt)

Submission status: Accepted

Solution code:
S = input()
print(sum([ int(s=='2') for s in S]))

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    N = input()
    print(N.count('2'))

input = lambda: stdin.readline()
main()

Submission status: Accepted

Solution code:
n = (input())
print(n.count('2'))

Submission status: Accepted

Solution code:
N = input()

ans = 0
for n in N:
    if n == '2':
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input().strip()

print(N.count("2"))

Submission status: Accepted

Solution code:

a = input()

result = 0

for i in a:
    if i == '2':
        result += 1

print(result)

Submission status: Accepted

Solution code:
n = str(input())

print(n.count('2'))

Submission status: Accepted

Solution code:
N=input()
count=0
for i in N:
    if i == "2":
        count+=1
print(count)

Submission status: Accepted

Solution code:
n = list(input())
c = 0
for i in n:
    if i == "2":
        c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = str(input())

print(N.count('2'))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
n = input()
print(n.count('2'))

Submission status: Accepted

Solution code:
n = input()
ans = 0

for v in n:
    if v == '2':
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
N=(stdin.readline().rstrip())
print(N.count("2"))

Submission status: Accepted

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


def main():
    """Function."""
    n = str(input())

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
c=0
while N>0:
    if N%10==2:
        c+=1
    N//=10
print(c)

Submission status: Accepted

Solution code:
s=input()

count=0
for x in range(4):
	if(int(s[x])==2):
		count+=1

print(count)

Submission status: Accepted

Solution code:
s = input()

cnt=0
for c in s:
    if c =="2":
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N=input()
ANS=N.count("2")
print(ANS)

Submission status: Accepted

Solution code:
N = input()
count = 0

for n in N:
    if n == "2":
        count += 1
        
print(count)

Submission status: Accepted

Solution code:
x = raw_input().strip()
ans = 0
for c in x:
	if c == '2':
		ans+= 1
print ans

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N = list(str(input()))

ans = 0 
for i in N:
    if i == '2':
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N=input()

count=0
for i in range(len(N)):
  if N[i]=='2':
    count+=1
    
print(count)

Submission status: Accepted

Solution code:
N = input()

ans = N.count("2")

print(ans)

Submission status: Accepted

Solution code:
a = str(input())
a = list(a)
b = a.count("2")
print(b)

Submission status: Accepted

Solution code:
print(raw_input().count('2'))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input().count('2')
print(n)

Submission status: Accepted

Solution code:
n = input()
c = 0
for i in range(len(n)):
    w = n[i]
    if w == "2":
        c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#a, b = map(int, input().split())
n = input()
print(n.count("2"))

Submission status: Accepted

Solution code:
N = list(input())

print(N.count("2"))

Submission status: Accepted

Solution code:
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
	n=str(input())
	print(n.count('2'))
    #a=list(map(int,sys.stdin.readline().split(' ')))
    #n,k,s= map(int, sys.stdin.readline().split(' '))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Submission status: Accepted

Solution code:
N = input()

r = N.count("2")

print(r)

Submission status: Accepted

Solution code:
a = input()

c = 0
for i in a:
    if i=="2":
        c += 1
print(c)

Submission status: Accepted

Solution code:
N=input()

print(N.count("2"))

Submission status: Accepted

Solution code:
s = input()
ans = 0

for i in s:
    if i == '2':
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
s = raw_input()
cnt = 0
for a in s:
	if a == '2':
		cnt += 1
print cnt

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
n = list(n)
print(n.count('2'))

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
from collections import Counter


input = sys.stdin.readline
INF = float('inf')
MOD = 10 ** 9 + 7


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


N = int(input())

ans = 0
for s in str(N):
    if s == '2':
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
# encoding: utf-8
S = input()
print(S.count('2'))

Submission status: Accepted

Solution code:
A = input()
print(A.count("2"))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())

k = 0

for i in range(len(a)):
	if a[i] == '2':
		k += 1

print(k)

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
n = int(input())
print(str(n).count("2"))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n =input()
print(n.count("2"))

Submission status: Accepted

Solution code:
N = input()
c = 0
for n in N:
    if n=="2":
        c+=1
print(c)

Submission status: Accepted

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


def main():
    n = input()
    print(n.count('2'))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = input()
print(n.count("2"))

Submission status: Accepted

Solution code:
N = input()
res = 0
for i in N:
    if i == "2":
        res += 1

print(res)

Submission status: Accepted

Solution code:
n = list(input())

print(n.count('2'))

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions
def j(a):
    if a: print("AC")
    else :print("WA")


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

#x = ip()                              #入力整数1つ
#x,y = (int(i) for i in input().split())      #入力整数横2つ
#x,y,z = (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列



print(a.count("2"))

Submission status: Accepted

Solution code:
def caddi2018b_a():
    n = input()
    print(n.count("2"))


caddi2018b_a()

Submission status: Accepted

Solution code:
N = input().strip()
print(N.count('2'))

Submission status: Runtime Error

Solution code:
N = int(input())
print(N.count("2"))

Submission status: Runtime Error

Solution code:
N = intput()
sum = 0
for i in range(0, len(N)):
  if N[i] == 2:
    sum += 1
print(sum)

Submission status: Runtime Error

Solution code:
print(input().count('2')

Submission status: Runtime Error

Solution code:

N=int(input())
cnt=N.count('2')
print(cnt)

Submission status: Runtime Error

Solution code:

N=list(int(input()))
cnt=N.count('2')
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input().split()
b = 0
for i in range(2):

    a.sort(reverse=True)
    print(a)
    b = b + int(a[1])
    a[1] = str(int(a[1]) - 1)
print(b)

Submission status: Runtime Error

Solution code:
N = int(input())

c = N.count(2)

print(c)

Submission status: Runtime Error

Solution code:
N,H,W = map(int,input().split())

count = 0
for i in range(N):
    a,b = map(int,input().split())
    
    if a >= H and b >= W :
        count += 1
print(count)

Submission status: Runtime Error

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