#include <bits/stdc++.h>
using namespace std;
long long pwr(long long base, long long p, long long mod) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    p /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n, q;
  cin >> n;
  long long neg = 0, pos = 0, temp;
  long long tn = 0, tp = 0;
  for (int i = 0; i < n; i++) {
    cin >> q;
    if (q > 0) {
      pos++;
    } else {
      temp = neg;
      neg = pos + 1;
      pos = temp;
    }
    tp += pos;
    tn += neg;
  }
  cout << tn << " " << tp << endl;
}
