#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 100100;
int main() {
  int n, x;
  long long ans1 = 0, ans2 = 0, s1 = 0, s2 = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    if (x > 0)
      s1++;
    else {
      swap(s1, s2);
      s2++;
    }
    ans1 += s1;
    ans2 += s2;
  }
  cout << ans2 << ' ' << ans1;
  return 0;
}
