#include <stdio.h>

int main()
{

    int ara [3] = {1,2,3};

    int A,B,i;
    scanf("%d",&A);
    scanf("%d",&B);

    for (i =0;i<3;i++){
        if(ara[i] != A && ara[i] != B){
            printf("%d\n",ara[i]);
        }
    }
    return 0;



}
