#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  long long ans2 = 0;
  long long a2 = 0;
  long long b2 = 0;
  for (long long i = 1; i <= n; i++) {
    if (a[i] > 0) {
      a2++;
      ans += a2;
      ans2 += b2;
    } else {
      swap(a2, b2);
      b2++;
      ans += a2;
      ans2 += b2;
    }
  }
  swap(ans, ans2);
  cout << ans << " " << ans2;
}
