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):
N = str(input())
print(N.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):
N=input()
print(N.count("2"))

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

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

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

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

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

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

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

Solution (Python):
n=input()
if n.count('2')==0:
  print(0)
if n.count('2')==1:
  print(1)
if n.count('2')==2:
  print(2)
if n.count('2')==3:
  print(3)
if n.count('2')==4:
  print(4)

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

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

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

Solution (Python):
A = list(input())
count = 0

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

print(count)

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

Solution (Python):
if __name__=="__main__":
  n=input()
  print(n.count('2'))

Solution (Python):
from sys import stdin
rs = lambda : stdin.readline().strip()
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def main():
    s = rs()
    ans = s.count('2')
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
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

    s=SI()
    count=0
    for i in range(4):
        if s[i]=="2":
            count+=1
    print(count)
        
        
        
        
    
if __name__=="__main__":
    main()

Solution (Python):
input_num = str(input())
cnt_2_in_str = lambda x: 1 if x == '2' else 0
print(sum(map(cnt_2_in_str,input_num)))

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

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

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

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

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

Solution (Python):
import sys

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


def main():
    N = input()

    print(N.count("2"))


if __name__ == '__main__':
    main()

Solution (Python):

import sys
def input():
    return sys.stdin.readline()[:-1]

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

if __name__ == '__main__':
    main()

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


if __name__ == "__main__":
    main()

Solution (Python):

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

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

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

Solution (Python):
n = input()
print(n.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 = list(input())
print(n.count("2"))

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

Solution (Python):
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N=pin()[:-1]
  print(N.count("2"))
  return 

main()

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()
ans=n.count('2')
print(ans)

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n = list(input())
print(n.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):
print(input().count('2'))

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = SS()

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

if __name__ == '__main__':
    resolve()

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = readline().decode('utf-8').strip()
    print(N.count('2'))

if __name__ == '__main__':
    main()

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 = list(input())
print(N.count('2'))

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

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

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

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

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

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

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

Solution (Python):






s = list(input())
print(s.count("2"))

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

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

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

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

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

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

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = S()
print(n.count('2'))

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = input()

print(N.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):
print(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):
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):


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    S=input()
    print(S.count("2"))

main()

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

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

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

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

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

Solution (Python):
def main():
    N = input()
    print(sum([n == '2' for n in N]))
if __name__ == '__main__':
    main()

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

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

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 = input()

print(n.count('2'))

Solution (Python):
print(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):
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):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


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

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

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

print (s.count('2'))

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

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

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

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

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


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


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count




c = Counter(S())
print(c["2"])

Solution (Python):
N = input()

c = N.count('2')

print(c)

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

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

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

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

Solution (Python):
import sys
import heapq
import re
from heapq import heapify, heappop, heappush
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


n = input()
ans = n.count("2")
print(ans)

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

Solution (Python):
import heapq
from sys import stdin
input = stdin.readline













def main():
    n = int(input())
    ans = 0
    while n >0:
        if n %10 == 2:
            ans += 1
        n= n//10
    print(ans)
if __name__ == '__main__':
    main()

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

Solution (Python):
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580

def solve():
    str = (input().rstrip())
    cnt = 0
    for s in str:
        if(s == '2'):
            cnt += 1
    
    print(cnt)
        
if __name__ == '__main__':
    solve()

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

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

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

print(cnt)

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    N=int(input())
    print(str(N).count('2'))
    
resolve()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

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

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()
ans=0
for i in range(4):
  if n[i]=="2":
    ans+=1
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    N = int(input())

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


if __name__ == "__main__":
    main()

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

print(count)

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

Solution (Python):
n = str(input())
print(n.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):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s = read().rstrip().decode()
print(s.count('2'))

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

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

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    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
    

    
    

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

if __name__ == '__main__':
    main()

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

Solution (Python):
N = input()

print(N.count('2'))

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=input()
    ans=0
    for nn in n:
        if nn=="2":ans+=1
    print(ans)

if __name__=='__main__':
    main()

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

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

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

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

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

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

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

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

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

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

Solution (Python):
s=input()
ans=0
if s[0]=='2':
    ans+=1
if s[1]=='2':
    ans+=1
if s[2]=='2':
    ans+=1
if s[3]=='2':
    ans+=1
print(ans)

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

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

Solution (Python):
N = list(input())
print(N.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):
n = input()
ans = n.count("2")
print(ans)

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

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    n = S()
    print(n.count("2"))
    return



if __name__ == '__main__':
    solve()

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [str(i) for i in input().split()]

    count = 0

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

Solution (Python):
def resolve():

    N= input()
    NN= [int(c) for c in N]
    print(NN.count(2))



resolve()

Solution (Python):
n = input()
print(n.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()
cnt = 0
for i in N:
    if i == "2":cnt+=1
print(cnt)

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

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

Solution (Python):
count = 0
S = list(input())
for ch in S:
  if ch == '2':
    count += 1
print(count)

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

res = 0
for i in n:
    if i == "2":
        res += 1

print(res)

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

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

Solution (Python):

from sys import setrecursionlimit
setrecursionlimit(10**6)
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]

N = list(input())
c = Counter(N)
print(c['2'])

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

Solution (Python):
s = input()

print(s.count("2"))

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


if __name__ == '__main__':
    main()

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

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

print(ans)

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

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

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

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

c = 0

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

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

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

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

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

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

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

Solution (Python):
n = input()

ans = 0

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

print(ans)

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

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

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

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

Solution (Python):
n = input()

print(n.count('2'))

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

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

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

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

Solution (Python):
import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy

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

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

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

Solution (Python):
import sys
import math
import fractions
import bisect
import queue
import heapq
from collections import deque
sys.setrecursionlimit(4100000)

MOD = int(1e9+7)
PI = 3.14159265358979323846264338327950288
INF = 1e18

'''
1行のint
N, K = map(int, input().split())

1行のstring
S, T = input().split()

1行の整数配列
P = list(map(int,input().split()))

改行あり整数
x = []
y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)

N行M列の初期化
dp = [[INF] * M for i in range(N)]

'''


N = input()
ans = 0
for n in N:
    if n == "2":
        ans += 1

print(ans)

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

Solution (Python):


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

Solution (Python):

import sys


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()
print(N.count("2"))

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

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

Solution (Python):

s = input()
cnt = 0
for i in s:
    if i == "2": cnt += 1

print(cnt)

Solution (Python):
n = list(str(i) for i in input())

print(sum(1 for i in n if i=='2'))

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

Solution (Python):
N = 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):
s = input().strip()

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

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

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

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

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

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

Solution (Python):


nList = list(input())

m = 0
for i in nList:
  if i == "2" :
    m = m + 1

print(m)

Solution (Python):
n=input()

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

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

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