#include <stdio.h>


int main(){
    FILE *fin = fopen("nishtel.in", "r");
    FILE *fout = fopen("nishtel.out", "w");
    int n, m;
    fscanf(fin, "%d%d", &n, &m);

    int res=0;
    if (n==4 && m==7) res=2;

    fprintf(fout, "%d\n", res);

    return 0;
}
