#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 gc getchar_unlocked
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long int
#define s(x)	cin>>x
#define p(x)	cout<<x<<"\n"
#define goog(x, y)  cout<<"Case #"<<x<<": "<<y<<"\n"
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define INF 100000000000
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpi;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
typedef long double ld;

mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int mpow(int base, int exp); 
void ipgraph(int n, int m);
void dfs(int u, int par);
int gcd(int a, int b) ;

const int mod = 1'000'000'007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int a[N];

void solve() {
  int n,a,b;cin>>n>>a>>b;
  p(n-a+b);
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

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

    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
    //u--, v--;
		g[u].pb(v);
		g[v].pb(u);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}

int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll                 long long
#define pb                 push_back
#define ppb                pop_back
#define endl               '\n'
#define mii                map<ll, ll>
#define pii                pair<ll, ll>
#define vi                 vector<ll>
#define all(a)             (a).begin(), (a).end()
#define mem0(x)            memset(x, 0, sizeof(x))
#define mem1(x)            memset(x, -1, sizeof(x))
#define F                  first
#define S                  second
#define sz(x)              ((ll)x.size())
#define DECIMAL(n)         cout<<fixed<<setprecision(n);
#define rep(i, a, b)       for (ll i=a; i<b; i++)
#define repr(i, a, b)      for (ll i=a-1; i>=b; i--)
#define bitcount(a)        (ll)__builtin_popcount(a)
#define lbnd               lower_bound
#define ubnd               upper_bound
#define ios                ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define trace(...)         __f(#__VA_ARGS__, __VA_ARGS__)

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// find_by_order(k) returns iterator to kth element starting from 0
// order_of_key(k) returns count of elements strictly smaller than k

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    std::cerr<<name<<" : "<<arg1<<endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names+1, ','); std::cerr.write(names, comma-names)<<" : "<<arg1<<" | "; 
    __f(comma+1, args...);
}

const long double PI=3.14159265358979323846264338;
const double eps=1e-10;
ll hell=1e9+7;
ll inf=((ll)5e18+5);

void solve() {
    ll n;
    cin>>n;
    ll arr[n];
    cin>>arr[0];
    ll ans=arr[0];
    rep(i, 1, n) {
        cin>>arr[i];
        ans=__gcd(ans, arr[i]);
    }
    cout<<ans<<endl;
}

signed main() {
    ios
    ll test=1;
    // cin>>test;
    while (test--) solve();
    return 0;
}