#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long arr[n + 1];
  arr[0] = 1;
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    if (x > 0)
      arr[i] = 1;
    else
      arr[i] = -1;
  }
  for (long long i = 1; i <= n; i++) {
    arr[i] = arr[i] * arr[i - 1];
  }
  long long plus[n + 1], minus[n + 1];
  memset(plus, 0, sizeof(plus));
  memset(minus, 0, sizeof(minus));
  for (long long i = 1; i <= n; i++) {
    if (arr[i] == 1) {
      plus[i] = 1;
    } else {
      minus[i] = 1;
    }
    plus[i] += plus[i - 1];
    minus[i] += minus[i - 1];
  }
  long long a = 0, b = 0;
  for (long long i = 1; i <= n; i++) {
    if (arr[i - 1] > 0) {
      a += (plus[n] - plus[i - 1]);
      b += (minus[n] - minus[i - 1]);
    } else {
      b += (plus[n] - plus[i - 1]);
      a += (minus[n] - minus[i - 1]);
    }
  }
  cout << b << " " << a << endl;
}
