#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
int A[MAXN];
long long dp[MAXN][2];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int t;
  for (int i = 1; i <= n; i++) {
    cin >> t;
    if (t < 0)
      A[i] = -1;
    else
      A[i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (A[i] == -1) {
      dp[i][0] = dp[i - 1][1];
      dp[i][1] = dp[i - 1][0] + 1;
    } else {
      dp[i][0] = 1 + dp[i - 1][0];
      dp[i][1] = dp[i - 1][1];
    }
  }
  long long ans1 = 0, ans2 = 0;
  for (int i = 1; i <= n; i++) {
    ans1 += dp[i][1];
    ans2 += dp[i][0];
  }
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
