// https://omegaup.com/arena/problem/Cuantos-valen-7 
#include <stdio.h> 
 
int main( ) { 
   int a, b; 
   scanf("%d%d", &a, &b); 
   int r = (a == 7) + (b == 7); 
   printf("%d", r); 
}