#include <bits/stdc++.h>
#define lg long long int
#define loop(i, s, e) for (lg i = s; i <= e; i++)
#define iloop(i, s, e) for (lg i = e; i >= s; i--)
#define pb push_back
#define mp make_pair
#define mod 1000000007
using namespace std;

lg min(lg a, lg b)
{
	return a < b ? a : b;
}
lg max(lg a, lg b)
{
	return a > b ? a : b;
}
lg lcm(lg a, lg b)
{
	return (a * b) / __gcd(a, b);
}
lg ans = 0;
lg n, a,b;
lg bin_Search(vector<lg>& nums, lg low,lg high,lg num){
	if(nums[low]>=num) return low;
	else if(nums[high]<=num) return high+1;
	else if(high-low<2) return high;
	else {
		lg mid = (low+high)/2;
		if(nums[mid]>num) return bin_Search(nums,low,mid,num);
		else if(nums[mid]<num) return bin_Search(nums,mid,high,num);
		else return mid;
	}
}
int main()
{
	cin>>n>>a>>b;
	cout<<n-a+b<<endl;
}
#include "bits/stdc++.h"
using namespace std;
#define int               long long
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll

template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}

const long long INF=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;

const int N=25;

int ans = 1;
vector<int> v[N];
int vis[N];
int col[N];
int lvl[N];

int dfs(int z){
	int ret = 1;
	vis[z] = 1;
	for(int x:v[z]){
		if(vis[x] != 0 && lvl[x] != lvl[z] + 1){
			if(col[x] == col[z]){
				ret = 0;
			}
			continue;
		}
		lvl[x] = lvl[z] + 1;
		int tmp = 0;
		rep(i,1,4){
			if(i == col[z]) continue;
			col[x] = i;
			tmp += dfs(x);
			col[x] = 0;
		}
		ret *= tmp;
	}
	return ret;
}

void solve(){
	int n,m;
	cin >> n >> m;
	rep(i,0,m){
		int a,b;
		cin >> a >> b;
		v[a].pb(b);
		v[b].pb(a);
	}
	
	rep(i,1,n+1){
		if(vis[i]) continue;
		col[i] = 1;
		lvl[i] = 1;
		ans *= 3 * dfs(i);
	}
	
	cout << ans;
}
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#ifdef SIEVE
		sieve();
	#endif
	#ifdef NCR
		init();
	#endif
	int t=1;
	//cin>>t;
	while(t--) solve();
	return 0;
}
