#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 0) {
    cout << 0;
    return 0;
  }
  int a[n];
  int i;
  for (i = 0; i < n; ++i) cin >> a[i];
  pair<int, int> dp[n];
  long long int nn, pp;
  nn = pp = 0;
  dp[0].first = (a[0] > 0) ? 1 : 0;
  dp[0].second = (a[0] < 0) ? 1 : 0;
  nn += dp[0].second;
  pp += dp[0].first;
  i = 0;
  for (i = 1; i < n; i++) {
    dp[i].first = (a[i] > 0) ? (dp[i - 1].first == 0) ? 1 : dp[i - 1].first + 1
                             : dp[i - 1].second;
    dp[i].second = (a[i] > 0)               ? dp[i - 1].second
                   : (dp[i - 1].first == 0) ? 1
                                            : dp[i - 1].first + 1;
    nn += dp[i].second;
    pp += dp[i].first;
  }
  cout << nn << " " << pp;
}
