На python
1)massiv=[int(x) for x in input().split()]
otvet=0
for x in massiv:
if x==5:
otvet+=1
print(otvet)
2)massiv=[int(x) for x in input().split()]
if x!=2:
На python
1)massiv=[int(x) for x in input().split()]
otvet=0
for x in massiv:
if x==5:
otvet+=1
print(otvet)
2)massiv=[int(x) for x in input().split()]
otvet=0
for x in massiv:
if x!=2:
otvet+=1
print(otvet)