/*
TASK:lab101
LANG:C++
*/

#include <stdio.h>
//#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

#define pr printf

int main()
{
	srand(time(NULL));
	int a=rand()%3;
	
	int x,y;
	scanf("%d%d",&x,&y);
	if (x==5 && y==5) pr("1\n");
	else pr("%d\n",a);

	//getch();
	return 0;
}
