#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < b; ++i)

int debug = 0;

const int N = 5000;
int n, x, d, a[N];
set <int> ds, s;

main() {
    cin >> n;
    rep(i, 0, n) {
        cin >> a[i];
        int d = 1;
        while (d * d <= a[i]) {
            if (a[i] % d == 0) {
                ds.insert(d);
                ds.insert(a[i] / d);
            }
            ++d;
        }
    }
    sort(a, a + n);
    for (int d : ds) {
        int x = 0, f = 0;
        rep(i, 0, n) {
            if (a[i] % d == 0) {
                f = 1;
                x = __gcd(x, a[i]);
                if (x == d) break;
            }
        }
        if (x == d && f == 1 && x <= a[0]) s.insert(d);
    }
    cout << s.size() << '\n';
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
const int MOD=1e9+7;
template <typename T>
vector<T> divisor(T n){
  vector<T> res;
  for (T i(1);i*i<=n;i++){
    if (n%i==0){
      res.push_back(i);
      // if (i != n/i) res.push_back(n/i);
    }
  }
  return res;
}

int main(){
  ll N;
  cin>>N;
  vector<ll> di = divisor(2*N);
  set<pair<ll,ll>> st;
  for(ll x:di){
    ll y = 2*N/x;
    ll b = (y-x+1);
    ll a = (y+x+1);
    if(a%2==0 && b%2==0) st.insert({a,b});
    // st.insert({a,b});
  }
  cout << st.size()*2 << endl;
  return 0;
}
