#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
vector<long long> a(N);
for (int i = 0; i < N; i++) cin >> a[i];
long long total = 0;
for (long long x : a) total += x;
int ans = 1; // ít nhất là 1 đoạn (cả mảng)
long long prefix = 0;
for (int i = 0; i < N; i++) {
prefix += a[i];
long long target = prefix;
long long cur = 0;
int cnt = 1; // đoạn đầu tiên
bool ok = true;
for (int j = i + 1; j < N; j++) {
cur += a[j];
if (cur == target) {
cnt++;
cur = 0;
} else if (cur > target) {
ok = false;
break;
}
}
if (ok && cur == 0) {
ans = max(ans, cnt);
}
}
cout << ans;
return 0;
}




















