#include <bits/stdc++.h>
/*#include <iostream>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <sstream>*/

#define ll long long
#define fop(i,m,n) for(int i=m; i<n; i++)
#define fastIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()

using namespace std;

const long long MOD = 1e9+7;
const long long N = 1e18+5;
const long long Nlog = 17;
const long long Hash = 257;

const double PI = 2.0*acos(0.0);//<cmath>
//const double PI = 3.141592653;
const double E = 2.718281828;

void solve(){
    
    int x, y;
    cin >> x >> y;
    if(x == y) cout << x;
    else{
        cout << 3-(x+y);
    }
    
}


int main()
{
    fastIO;

    int t=1;
    //cin >> t;
    while(t--) solve();

    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define mp(a,b) make_pair(a,b)
#define vi vector<int>
#define mii map<int,int>
#define mpi map<pair<int,int>,int>
#define vp vector<pair<int,int> >
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define rep(i,a,n) for(i=a;i<n;i++)
#define F first
#define S second
#define endl "\n"
#define fast std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define dom 998244353
#define pi 3.14159265
#define sl(a) (int)a.length()
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define pii pair<int,int> 
#define mini 2000000000000000000
#define time_taken 1.0 * clock() / CLOCKS_PER_SEC
//mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//primes for hashing 937, 1013
template<typename T, typename U> static inline void amin(T &x, U y) 
{ 
    if (y < x) 
        x = y; 
}
template<typename T, typename U> static inline void amax(T &x, U y) 
{ 
    if (x < y) 
        x = y; 
}
void shikhar7s(int cas)
{
    int n,m,i;
    cin>>n>>m;
    int u,v;
    int ed[n+5][n+5];
    memset(ed,0,sizeof(ed));
    fr(i,m)
    {
        cin>>u>>v;
        ed[u-1][v-1]=1;
        ed[v-1][u-1]=1;
    }
    int nn=(1ll<<n),j,k;
    int dp[nn+5],lc[nn+5],va[nn+5]={0};
    rep(i,1,nn)
    {
        fr(j,n)
        {
            if((1ll<<j)&i)
            {
                lc[i]=j;
                break;
            }
        }
    }
    rep(i,1,nn)
    {
        vi w;
        fr(j,n)
        {
            if((1ll<<j)&i)
                w.pb(j);
        }
        int f=0;
        fr(j,sz(w)-1)
        {
            rep(k,j+1,sz(w))
            {
                if(!ed[w[j]][w[k]])
                {
                    f=1;
                    break;
                }
            }
            if(f)
                break;
        }
        if(f)
        {
            dp[i]=mini;
            int mm=(1ll<<sz(w));
            rep(j,1,mm/2)
            {
                va[j]=va[(j-(1ll<<lc[j]))]+(1ll<<w[lc[j]]);
                //cout<<va[j]<<" "<<j<<" "<<lc[j]<<" "<<w[j]<<" "<<sz(w)<<endl;
                dp[i]=min(dp[i],dp[va[j]]+dp[i-va[j]]);
            }
        }
        else
            dp[i]=1;
    }
    cout<<dp[i-1];
}
signed main()
{
    fast;
    int t=1;
    //cin>>t;
    int cas=1;
    while(cas<=t)
    {
    shikhar7s(cas);
    cas++;
    }
    return 0;
}