#include<stdio.h>
int main()
{
    int x=1,y=2,A,B;
    scanf("%d",&A);
    scanf("%d",&B);
    if (x != A && x != B){
        printf("%d\n",x);
    }
    else if(y != A && y != B){

        printf("%d\n",y);
    }
    else{
        printf("3");
    }
        return 0;



}
