#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < 0)
      a[i] = 1;
    else
      a[i] = 0;
  }
  long long cnt = 0, pre = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    pre ^= a[i];
    if (pre == 0) {
      cnt++;
      ans += i + 1 - cnt;
    } else
      ans += cnt + 1;
  }
  cout << ans << " " << (n * (n + 1)) / 2 - ans;
}
