#include<bits/stdc++.h>
using namespace std;
int n,a[100010];
inline int read()
{
	int x=0,w=0;char ch=0;
	while(!isdigit(ch)){w|=ch=='-';ch=getchar();}
	while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
	return w?-x:x;
}
int gcd(int N,int M)
{while(N^=M^=N^=M%=N);return M;}
int main()
{
	n=read();
	for(int i=1;i<=n;i++){
		a[i]=read();
		a[1]=gcd(a[1],a[i]);
	}
	cout<<a[1]<<'\n';
}
#include <iostream>

using namespace std;

const int kMaxN = 21;

int l[kMaxN][kMaxN], a[kMaxN], b[kMaxN];
int n, m, x, y, t, c;
long long ans = 1;

void S(int x) {
  if (b[x]) {
    return;
  }
  a[++t] = x;
  b[x] = 1;
  for (int i = 1; i <= n; i++) {
    if (l[x][i]) {
      S(i);
    }
  }
}

void P(int x) {
  if (x > t) {
    c++;
    return;
  }
  int v[4] = {0};
  for (int i = 1; i < x; i++) {
    if (l[a[i]][a[x]]) {
      v[b[a[i]]] = 1;
    }
  }
  for (int i = 1; i <= 3; i++) {
    if (!v[i]) {
      b[a[x]] = i;
      P(x + 1);
    }
  }
}

int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    l[x][y] = l[y][x] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (!b[i]) {
      t = c = 0;
      S(i);
      P(1);
      ans *= c;
    }
  }
  cout << ans;
  return 0;
}