#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
long long a[maxn], dp[maxn][2];
int main() {
  long long n;
  cin >> n;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  dp[0][0] = dp[0][1] = 0;
  if (a[0] < 0)
    dp[0][0]++;
  else
    dp[0][1]++;
  for (int i = 1; i < n; i++) {
    if (a[i] < 0) {
      dp[i][0] = dp[i - 1][1] + 1;
      dp[i][1] = dp[i - 1][0];
    } else {
      dp[i][0] = dp[i - 1][0];
      dp[i][1] = dp[i - 1][1] + 1;
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += dp[i][0];
  }
  cout << ans << " ";
  ans = n * (n + 1) / 2 - ans;
  cout << ans << endl;
}
