#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long int pos = 0, neg = 0, balance = 0;
  long long int answer = 0;
  for (int i = 0; i < n; i++) {
    if (balance % 2 == 0) {
      ++pos;
    } else {
      ++neg;
    }
    if (arr[i] < 0) {
      balance++;
    }
    if (balance % 2 == 0) {
      answer += pos;
    } else {
      answer += neg;
    }
  }
  cout << n * 1LL * (n + 1) / 2 - answer << " " << answer << "\n";
  return 0;
}
