#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];
  dp[0][0] = 0, dp[0][1] = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i - 1] > 0) {
      dp[i][0] = dp[i - 1][0] + 1;
      dp[i][1] = dp[i - 1][1];
    } else {
      dp[i][0] = dp[i - 1][1];
      dp[i][1] = dp[i - 1][0] + 1;
    }
  }
  long long int sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n; ++i) {
    sum1 += dp[i][1];
    sum2 += dp[i][0];
  }
  cout << sum1 << " " << sum2;
  return 0;
}
