#include <bits/stdc++.h>
using namespace std;
long long i, j, p, l, m, n, c, d, t, k;
long long a[int(3e5 + 11)];
string s;
long long dp[4][2][int(3e5 + 11)];
int main() {
  cin >> s;
  long long n = s.size();
  long long pas1 = 0, pas2 = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == 'a') {
      dp[0][0][i] = dp[1][1][i - 1] + dp[0][1][i - 1];
      dp[0][1][i] = dp[1][0][i - 1] + dp[0][0][i - 1] + 1;
      dp[2][0][i] = dp[2][1][i - 1] + dp[3][1][i - 1];
      dp[2][1][i] = dp[2][0][i - 1] + dp[3][0][i - 1];
    } else {
      dp[3][0][i] = dp[2][1][i - 1] + dp[3][1][i - 1];
      dp[3][1][i] = dp[2][0][i - 1] + dp[3][0][i - 1] + 1;
      dp[1][0][i] = dp[1][1][i - 1] + dp[0][1][i - 1];
      dp[1][1][i] = dp[1][0][i - 1] + dp[0][0][i - 1];
    }
    pas1 += dp[0][0][i] + dp[3][0][i];
    pas2 += dp[0][1][i] + dp[3][1][i];
  }
  cout << pas1 << " " << pas2;
  return 0;
}
