#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ans = 0, even = 1, odd = 0, flag = 0, x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x < 0) flag ^= 1;
    if (flag == 0) {
      ans += even;
      even++;
    } else {
      ans += odd;
      odd++;
    }
  }
  cout << ((n * (n + 1LL)) >> 1) - ans << " " << ans << endl;
}
