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

Solution (Python):
s = input()
ans = 0
for k in s:
  if k=='2':
    ans += 1
    
    
print(ans)

Solution (Python):
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def my_round(a,dig=0):
    p = 10 ** dig
    return (a * p * 2 + 1) // 2 / p

def gcd(a,b): 
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): 
    return a/gcd(a,b)*b

def divisors(a): 
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): 
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): 
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): 
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    n = input()
    ans = 0
    for i in range(4):
        if n[i] == '2':
            ans += 1
    print(ans)
    return

if __name__=='__main__':
    main()

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

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

Solution (Python):
from sys import stdin

s = stdin.readline().rstrip()

print(s.count("2"))

Solution (Python):
def main():
    N = input()
    ans = 0
    for i in N:
        if i == "2":
            ans += 1
    print(ans)
if __name__ == '__main__':
    main()

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

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

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

Solution (Python):


N = input()

print(N.count('2'))

Solution (Python):
print(input().count("2"))

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n=input()
C=collections.Counter(n)
print(C["2"])

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

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

Solution (Python):
a = input()
b = list(a)

print(b.count('2'))

Solution (Python):

 
import math
import itertools
import sys
import copy
 


N = str(input())

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

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

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

Solution (Python):
result = 0
for i in input():
  if i == "2":
    result += 1
print(result)

Solution (Python):
N=list(input())

print(N.count('2'))

Solution (Python):
print(input().count("2"))

Solution (Python):
N = list( input() )
istwo = [ x == "2" for x in N ]
print( sum( istwo ) )

Solution (Python):
n = input()

print(n.count('2'))

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

Solution (Python):
n = list(str(input()))
cnt = 0
for i in n:
    if i == "2":
        cnt += 1
print(cnt)

Solution (Python):
N = input()
ans = N.count("2")
print(ans)

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

Solution (Python):
N = input().strip()
print(N.count("2"))

Solution (Python):
N = input().strip()
print(N.count("2"))

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

Solution (Python):
S=input()

print(S.count('2'))

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

Solution (Python):
print(input().count("2"))

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

Solution (Python):


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

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

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

Solution (Python):


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

Solution (Python):
S = input()
print(S.count('2'))

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = str(readline().rstrip().decode('utf-8'))
    print(n.count("2"))


if __name__ == '__main__':
    solve()

Solution (Python):

S = input()
ans = 0

for i in S:
  if i == "2":
    ans += 1
    
print (ans)

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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
 



 




 


 





 


 
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    N = str(N)
    ans = 0
    for i in N:
        if i == "2":
            ans += 1
            
    print(ans)
    
    
    
if __name__ == "__main__":
	main()

Solution (Python):
print(list(input()).count("2"))

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

print(cnt)

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

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

Solution (Python):
print(input().count("2"))

Solution (Python):
print(input().count("2"))

Solution (Python):
print(input().count("2"))

Solution (Python):

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

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

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

Solution (Python):
n=input()
N=list(n)
count=0
for i in range(4):
    if N[i]=='2':
        count+=1
print(count)

Solution (Python):
print(input().count("2"))

Solution (Python):
n=str(input())

def solve(n):
  return n.count('2')

print(solve(n))

Solution (Python):
print(input().count("2"))

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10000)
INF = 1<<32


def solve(N: int):
    print(str(N).count('2'))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
def main(n):
    print(str(n).count('2'))


if __name__ == '__main__':
    n = int(input())
    main(n)

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

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

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

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

Solution (Python):
from collections import Counter
N = input()
counter = Counter(N)
print(counter["2"])

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

Solution (Python):
import sys
import collections
import copy
import math
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

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

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = str(input().rstrip('\n'))
    print(n.count("2"))


if __name__ == '__main__':
    slove()

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

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

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

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

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

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

Solution (Python):
print(str(input()).count("2"))

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

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

Solution (Python):
from sys import stdin

def solve() :
    N = stdin.readline().rstrip()
    ans = 0
    for x in N:
        if(x == "2") :
            ans += 1

    print(ans)
solve();

Solution (Python):
n = list(input())

cnt = 0

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

Solution (Python):
print(input().count("2"))

Solution (Python):
def solve():
  print(input().count("2"))
solve()

Solution (Python):
i = input()
print(i.count("2"))

Solution (Python):
N = input()
r = N.count("2")
print(r)

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

Solution (Python):
def main():
    N = input()
    cnt = 0
    for c in N:
        if c == "2": cnt += 1
    return cnt


if __name__ == '__main__':
    print(main())

Solution (Python):
print(input().count("2"))

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = str(input().rstrip('\n'))
    print(n.count("2"))


if __name__ == '__main__':
    slove()

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

Solution (Python):
print(input().count("2"))

Solution (Python):
print(input().count("2"))

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

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

print(ans)

Solution (Python):
print(input().count("2"))

Solution (Python):
N = input()
c = 0
if N[0] == "2":
  c += 1
if N[1] == "2":
  c += 1
if N[2] == "2":
  c += 1
if N[3] == "2":
  c += 1
print(c)

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

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

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

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

Solution (Python):
print(input().count("2"))

Solution (Python):



N = input()



result = 0

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

print(result)

Solution (Python):
print(list(input()).count('2'))

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

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

Solution (Python):

import sys, math, fractions, itertools


def solve(N: int):
    print(str(N).count('2'))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):

n=input()

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

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

Solution (Python):
N = input()
ans = N.count("2")
print(ans)

Solution (Python):
N = list(input())
ans = N.count("2")
print(ans)

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

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

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

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

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

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

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

Solution (Python):
print(input().count("2"))

Solution (Python):
print(str(input()).count("2"))

Solution (Python):

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


if __name__ == "__main__":
    main()

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

Solution (Python):
print(input().count("2"))

Solution (Python):
print(input().count("2"))

Solution (Python):
S = input()
ans = 0
for s in S:
    if s == "2":
        ans += 1
print(ans)

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

Solution (Python):
S = list(input())
print(S.count("2"))

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

Solution (Python):
def solve(n):
    return len(list(filter(lambda _: _=="2", list(n))))
n = input()
print(solve(n))

Solution (Python):
N = input().rstrip()

print(N.count('2'))

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

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

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

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

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

Solution (Python):
print(input().count("2"))

Solution (Python):
print(input().count("2"))

Solution (Python):
print(input().count("2"))

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

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

Solution (Python):
print(input().count("2"))

Solution (Python):
print(input().count("2"))

Solution (Python):
N = str(input())
ans = 0
for i in range(0, len(N)):
    if N[i] == "2":
        ans = ans + 1
print(ans)

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

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

Solution (Python):
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
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
N = list(input())
print(N.count("2"))

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

Solution (Python):
print(input().count("2"))

Solution (Python):
print(input().count("2"))

Solution (Python):

import sys
input = sys.stdin.readline
def mi(): return map(int, input().split())


N = input()

print(N.count('2'))

Solution (Python):
print(input().count("2"))

Solution (Python):
n = list(map(int, input()))
cnt = 0
for i in n:
    if i == 2:
        cnt +=1
print(cnt)

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

print(cnt)

Solution (Python):
print(input().count("2"))

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

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

Solution (Python):
N = input()

print(N.count('2'))

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

Solution (Python):

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

Solution (Python):
N = [i for i in input()]
print(N.count("2"))

Solution (Python):
print(input().count("2"))

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

Solution (Python):
def main():
    N = input()
    ans = 0
    for c in N:
        if c == "2":
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = str(input())
ans = 0
for i in range(4):
    if N[i] == "2":
        ans += 1
    else:
        ans += 0
print(ans)

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

Solution (Python):
a=input()

b=a.count("2")

print(b)

Solution (Python):
print(input().count("2"))

Solution (Python):
print(input().count("2"))

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

Solution (Python):
s = input()

print(s.count('2'))

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

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

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

Solution (Python):
n = input()

print(n.count("2"))

Solution (Python):
n = str(int(input()))

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

print(count)

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

Solution (Python):
print(input().count("2"))

Solution (Python):
s=input()
count=0
for i in range(4):
  if s[i]=='2':
    count+=1
print(count)

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

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

Solution (Python):
s = input()
count = 0
for i in range(4):
    if s[i] == '2':
        count += 1
print(count)

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

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

Solution (Python):
N = input()

print(N.count('2'))

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

Solution (Python):
n = list(map(int, input()))
cnt = 0
for i in n:
    if i == 2:
        cnt +=1
print(cnt)

Solution (Python):
n = list(map(int, input()))
cnt = 0
for i in range(4):
    if n[i] == 2:
        cnt +=1
print(cnt)

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

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

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

Solution (Python):
print(input().count("2"))

Solution (Python):
print(str(input()).count('2'))

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

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

Solution (Python):
print(input().count("2"))

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

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

Solution (Python):
print(input().count("2"))

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

Solution (Python):
N = int(input())

ans = str(N).count("2")

print(ans)
print()

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

Solution (Python):
print(input().count("2"))

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

Solution (Python):
print(input().count("2"))

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

Solution (Python):
S = input()
c = 0
for i in range(4):
  if S[i] == '2':
    c += 1
print(c)

Solution (Python):



import sys  
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools



sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
def dump(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' => '+repr(arg) for arg in args), file=sys.stderr)


def local_input():
    from pcm.utils import set_stdin
    import sys
    from pathlib import Path
    parentdir = Path(os.path.dirname(__file__)).parent
    inputfile = parentdir.joinpath('test/sample-1.in')
    if len(sys.argv) == 1:
        set_stdin(inputfile)


def solve():
    n = input()
    res = 0
    for c in n:
        if c=='2':
            res += 1;
    print(res)
    return 0

if __name__ == "__main__":
    try:
        local_input()
    except:
        pass
    solve()

Solution (Python):
n=int(input())
ans=0
while n>0:
    if n%10==2:
        ans+=1
    n=n//10
print(ans)

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

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

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

Solution (Python):
s = input()
ct = 0
for i in range(4):
  if s[i] == '2':ct+=1
print(ct)

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

Solution (Python):
a = list(input())
print(a.count("2"))

Solution (Python):
import re

N = input()

if "2" in N:
    L = re.findall("2",N)
    print(len(L))
else:
    print("0")

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

Solution (Python):
print(input().count("2"))

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

Solution (Python):
S = input()

ans = 0

for c in S:
  if c == "2":
    ans += 1
    
print(ans)

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

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

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

Solution (Python):
N = list(input())
cnt = 0
for i in N:
    if i == "2":
        cnt += 1

print(cnt)

Solution (Python):
print(str(input()).count("2"))

Solution (Python):
print(input().count("2"))

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

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

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

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

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

Solution (Python):

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

Solution (Python):
input = input()
print(len([i for i in input if int(i) == 2]))

Solution (Python):
str_num = input()
count = 0
for c in str_num:
  if c == "2":
    count += 1
print(count)

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

Solution (Python):

import numpy as np

s = input()
list_s = list(s)

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

print(count)

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

Solution (Python):
num = int(raw_input())
total = 0

while num > 0:
	if num%10 == 2:
		total +=1
	num = num/10

print total

Solution (Python):
a = int(input())

def f1(i):
    lst = []
    while i > 0:
        lst.append(i%10)
        i //= 10
    lst.reverse()
    return lst

b = f1(a)
c = 0
for i in range(4):
    if b[i]==2:
        c += 1
    else:
        c = c

print(c)

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

Solution (Python):
print(input().count("2"))

Solution (Python):



def main():
    print((input().strip()).count('2'))

if __name__ == "__main__":
    main()

Solution (Python):
string = str(input())
print(sum([1 for ch in string if ch == '2']))

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

Solution (Python):
s=[x for x in input().split("2")]
print(len(s)-1)

Solution (Python):
x = input()
cnt = 0
for i in x:
  if i == '2':
    cnt+=1
print(cnt)

Solution (Python):
try:
    print(input().count('2'))
except EOFError:
    pass

Solution (Python):
s=input()
ans=0
for moji in s:
  if moji == '2':
    ans += 1
    
print(ans)

Solution (Python):

"""
Created on Mon Dec 31 14:08:31 2018

@author: Yamazaki Kenichi
"""
a = input()
print(a.count('2'))

Solution (Python):
a = int(input())

answer = 0

if a//1000 == 2:
    answer += 1

if (a//100)%10==2:
    answer += 1

if (a//10)%10==2:
    answer += 1

if (a//1)%10==2:
    answer += 1
print(answer)

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

Solution (Python):
n=int(input())
cnt=0
while n >= 1:
    if n%10==2:
        cnt+=1
    n=int(n/10)
print(cnt)

Solution (Python):
def main():
    txt = input()
    print(txt.count('2'))
    return

main()

Solution (Python):
num = input()
ans = 0

while num > 0:
    if num%10 == 2:
        ans += 1
    num /= 10

print ans

Solution (Python):
num = input()
print(num.count('2'))

Solution (Python):
print(input().count("2"))

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

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

Solution (Python):
import sys

a = list(input())

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

print(cnt)

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = S()
    r = 0
    for c in n:
        if c == '2':
            r += 1

    return r


print(main())

Solution (Python):
print(input().count("2"))

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

Solution (Python):
l = list(map(int,input()))
count = 0
for item in l:
  if item == 2:
    count += 1
print(count)

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

Solution (Python):
print(input().count("2"))

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

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

Solution (Python):
print(input().count("2"))

Solution (Python):
N = input()

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

print(cnt)

Solution (Python):
print(list(input()).count("2"))

Solution (Python):
from collections import Counter
print(Counter(list(input()))['2'])

Solution (Python):
print(str(input()).count('2'))

Solution (Python):
print(input().count("2"))

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

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

Solution (Python):
n = list(input())
cou = 0

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

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

Solution (Python):
s=input()
c=s.count("2")
print(c)

Solution (Python):
res = sum([True for _ in input() if _ == '2'])
print(res)

Solution (Python):
from collections import Counter
print Counter(raw_input())['2']

Solution (Python):
N = list(input())
print(N.count("2"))

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

Solution (Python):
N=input()
N_str=str(N)
Result=0
for n in N_str:
    if n=="2":
        Result+=1
print Result

Solution (Python):
import collections
line = list(input())
print(line.count('2'))

Solution (Python):
print(list(input()).count("2"))

Solution (Python):
N= input()
s = N.count("2")
print(s)

Solution (Python):
num = input()
print(sum([int(n=='2') for n in num]))

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

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

Solution (Python):
n = input()
a = 0

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

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

Solution (Python):
print(input().count("2"))

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

Solution (Python):
print(input().count("2"))

Solution (Python):
N = raw_input()
print(N.count('2'))

Solution (Python):
l=list(input())
print(l.count("2"))

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

Solution (Python):
print(input().count("2"))

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

Solution (Python):
print(input().count("2"))

Solution (Python):
n = int(raw_input())

count = 0

for i in xrange(4):

    if (n % 10) == 2:
        count += 1

    n /= 10

print count

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

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

Solution (Python):
suuji = input()
kaisu = 0
for i in suuji:
	if i == "2":
		kaisu += 1
	else:
		pass
print(kaisu)

Solution (Python):










N = int(input())
print("{}".format(str(N).count('2')))

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

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

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

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

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

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

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

Solution (Python):
print(list(input()).count('2'))

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

Solution (Python):
N = int(input())

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

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

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

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

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

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

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

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

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

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

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

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

print(count)

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

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

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

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

    return count


print(count_of_2(input()))

Solution (Python):
print(input().count("2"))

Solution (Python):
N = list(input())

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

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

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

Solution (Python):
import io

str_in = list(input())
count = 0

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

print(count)