#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 123;
int n;
int a[N];
vector<int> g;
vector<int> z;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (x < 0) {
      g.push_back(i);
    }
  }
  long long bad = 0;
  long long good = (n)*1LL * (n + 1) / 2LL;
  for (int i = 0; i < (int)g.size(); i++) {
    int v = g[i];
    if (i == 0) {
      z.push_back(v);
    } else {
      z.push_back(v - g[i - 1]);
    }
    if (i == (int)g.size() - 1) {
      z.push_back(n - v + 1);
    }
  }
  long long ct = 0, cc = 0;
  for (int i = 0; i < (int)z.size(); i++) {
    if (i % 2 == 0) {
      ct += z[i];
    } else {
      cc += z[i];
    }
  }
  for (int i = 0; i < (int)z.size() - 1; i++) {
    if (i % 2 == 0) {
      ct -= z[i];
      bad += z[i] * 1LL * (cc);
    } else {
      cc -= z[i];
      bad += z[i] * 1LL * (ct);
    }
  }
  good = good - bad;
  cout << bad << " " << good;
}
