#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, l, m, n = 0, a, b, c, d, x, y, p = 0, ans1 = 0, ans2 = 0;
  cin >> m;
  long long md[m];
  for (i = 0; i < m; i++) {
    cin >> md[i];
    if (md[i] > 0) {
      p = p + 1;
    } else {
      k = p;
      p = n;
      n = k + 1;
    }
    ans1 = ans1 + p;
    ans2 = ans2 + n;
  }
  cout << ans2 << " " << ans1;
}
