#include <iostream>

int main() {
  int x, y, z;
  std::cin >> x >> y;
  if (x == y) z = x;
  else z = 3 - x - y;
  std::cout << z << std::endl;
  return 0;
}
#include<iostream>
#include<algorithm>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
#include<vector>
#include<set>
#define ll long long
#define pb push_back
#define forn(i,x,n) for(int i=x;i<=n;++i)
#define forr(i,x,n) for(int i=n;i>=x;--i)
#define lson (rt<< 1)
#define rson (rt<< 1 | 1)
#define gmid ((l+r)>> 1 )
using namespace std;

const int maxn=20000050;
int main()
{
	int x,y;
	cin>>x>>y;
	if(x==y)
	  cout<<x<<endl;
	else cout<<3-x-y<<endl;   
}
