#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const int mxn = 200020, INF = 1e9 + 7;
int dp[mxn][2], N, a[mxn];
lint ans1 = 0, ans2 = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> a[i];
  for (int i = 1; i <= N; i++) {
    if (a[i] > 0) {
      dp[i][0] = 1 + dp[i - 1][0];
      dp[i][1] = dp[i - 1][1];
    } else {
      dp[i][0] = dp[i - 1][1];
      dp[i][1] = 1 + dp[i - 1][0];
    }
    ans1 += dp[i][1], ans2 += dp[i][0];
  }
  cout << ans1 << ' ' << ans2 << '\n';
}
