#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long ce{}, co{}, ctoe{}, ans{};
  for (long long i{}; i < n; ++i) {
    long long a;
    cin >> a;
    if (a > 0) {
      if (ctoe == 2) {
        ce++;
        ans += ce;
      } else {
        co++;
        ans += co;
      }
    } else {
      if (ctoe == 2) {
        ce++;
        ans += co;
        ctoe = 1;
      } else {
        co++;
        ans += ce;
        ctoe = 2;
      }
    }
  }
  cout << n * (n + 1) / 2 - ans << " " << ans << endl;
}
