#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long mod = 1e9 + 7;
long long dp[200003];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> v;
  long long a[n + 1], i, j;
  for (i = 1; i <= n; ++i) {
    cin >> a[i];
    a[i] = (a[i] < 0 ? -1 : 1);
    if (a[i] < 0) v.push_back(i);
  }
  v.push_back(i);
  long long cn = 0, ans = 0, sz = v.size(), prev = 0;
  for (j = 0; j <= sz - 2; ++j) {
    i = v[j];
    dp[j] = (i - prev);
    if (j > 1) dp[j] += dp[j - 2];
    ans += (v[j + 1] - v[j]) * dp[j];
    prev = i;
  }
  cout << ans << ' ' << (n * (n + 1ll) >> 1ll) - ans;
  return 0;
}
