#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define rep(i,j,k) for(int i=(j);i<=(k);i++)
#define per(i,j,k) for(int i=(j);i>=(k);i--)
using namespace std;
void setIn(string s){freopen(s.c_str(),"r",stdin);}
void setOu(string s){freopen(s.c_str(),"w",stdout);}
void setIO(string s){setIn(s+".in");setOu(s+".out");}
typedef pair<int,int> pii;
template<class T>void chkmax(T &a,T b){a=max(a,b);}
template<class T>void chkmin(T &a,T b){a=min(a,b);}
template<class T>T read(T &x)
{
	x=0;T f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-'){f=-1;}c=getchar();}
	while(isdigit(c)){x=x*10+(c-'0');c=getchar();}
	return x=x*f;
}
template<class T>void write(T x)
{
	if(x<0){putchar('-');x=-x;}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}
template<class T>void write(T x,char c){write(x),putchar(c);}
int n,m;
signed main()
{
	setIO("barrack");
	read(n),read(m);
	if(n==1)write(1);
	if(n==2)
	{
		if(m==0)write(3);
		if(m==1)write(5);
	}
	write(114514);
}