#include <bits/stdc++.h>
using namespace std;
int main ()
{
  char S[10];
  cin>>S;

  int ans = 0;
  for (int i = 0; i < 4; ++i)
  {
  	if (S == 4) ans++;
  	
    else
    	ans--;
  	

  }
  cout<<ans;

  return 0;
}
