#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long int dp[n + 1][2];
  int count1 = 0, count2 = 0;
  long long int sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n; ++i) {
    int kk, bk;
    if (a[i - 1] > 0) {
      kk = count1 + 1;
      bk = count2;
    } else {
      kk = count2;
      bk = count1 + 1;
    }
    count1 = kk;
    count2 = bk;
    sum1 += count2;
    sum2 += count1;
  }
  cout << sum1 << " " << sum2;
  return 0;
}
