#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define deb(x)        cerr << #x << " = " << x << "\n";
#define deb2(x, y)    cerr << #x << " = " << x << ", " << #y << " = " << y << "\n";
#define deb3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << "\n";

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define f  first
#define s  second

#define all(x) begin(x), end(x)
#define sz(x) (int)x.size()

template<typename T>
using oset = tree<T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;  

void solve(int tc) {
    int n;
    cin >> n;
    vector<ll> v(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
    ll g = v[0];
    for (int i = 0; i < n-1; ++i) {
        g = __gcd(g, v[i+1]);
    }
    cout << g << '\n';
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    int tc = 1;
    //cin >> tc;

    for (int i = 1; i <= tc; ++i) {
        solve(i);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i < n; i++)
using ll = long long;
using P = pair<int,int>;

const ll INF = 1e18;
const int MX = 2005;

ll factorial(ll l){
    if(l == 1 || l == 0){
        return 1;
    }else{
        return l * factorial(l-1);
    }
}

int main() {
    ll L;
    cin >> L;
    ll ans = 1;
    vector<bool> ch(11,true);
    rep(i,11){
        ans *= L - i - 1;
        rep(j,11){
            if(ch[j]){
                if(ans % (j+1) == 0){
                    ans /= j+1;
                    ch[j] = false;
                }
            }
        }
    } 
    cout << ans << endl;
}