#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 50;
const int INF = 0x3f3f3f3f;
const long long MOD = 1e9 + 7;
template <class T>
inline bool scan_d(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
int main() {
  long long n;
  cin >> n;
  int temp;
  long long pos = 0, neg = 0;
  long long ansa = 0, ansb = 0;
  for (int i = 1; i <= n; i++) {
    cin >> temp;
    if (temp > 0) {
      pos++;
      ansa += pos;
      ansb += neg;
    } else {
      swap(neg, pos);
      neg++;
      ansb += neg;
      ansa += pos;
    }
  }
  cout << ansb << " " << ansa;
  return 0;
}
