#include using namespace std; int main() { int n=0,ans=0; cin >>n; int tmp=n; while(tmp>=1) { if(tmp%10==2) ans++; tmp/=10; } cout<