#include <bits/stdc++.h>
using namespace std;
const int maxx = 2e5 + 7;
int n, a[maxx];
int mul = 1;
long long cnt1, cnt2;
long long ans1, ans2;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] < 0)
      a[i] = -1;
    else
      a[i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    mul *= a[i];
    if (mul < 0) {
      ans1++;
      ans1 += cnt2;
      ans2 += cnt1;
      cnt1++;
    } else {
      ans2++;
      ans1 += cnt1;
      ans2 += cnt2;
      cnt2++;
    }
  }
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
