#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long dp[N][2][2][3][2][2][2] = {};
string s;
long long solve(int idx, bool A, bool B, int prv, bool OFF, bool len,
                bool even) {
  if (idx >= (int)s.size()) {
    if (A == B) return 0;
    return (len == even);
  }
  long long &ret = dp[idx][A][B][prv][OFF][len][even];
  if (~ret) return ret;
  ret = 0;
  if (OFF || prv == 2) ret += solve(idx + 1, A, B, prv, OFF, len, even);
  if (!OFF) {
    if (s[idx] == 'a') {
      if (prv == 1)
        ret += solve(idx + 1, A, B, prv, OFF, len ^ 1, even);
      else
        ret += solve(idx + 1, A ^ 1, B, 1, OFF, len ^ 1, even);
    }
    if (s[idx] == 'b') {
      if (!prv)
        ret += solve(idx + 1, A, B, prv, OFF, len ^ 1, even);
      else
        ret += solve(idx + 1, A, B ^ 1, 0, OFF, len ^ 1, even);
    }
    if (A != B) ret += solve(idx + 1, A, B, prv, true, len, even);
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(0), ios_base::sync_with_stdio(0), cin.tie(0),
      cout.tie(0);
  ;
  cin >> s;
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0, 0, 2, 0, 0, 0) << " " << solve(0, 0, 0, 2, 0, 0, 1)
       << "\n";
  return 0;
}
