#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int inf = 1e18 + 1e17;
const long long int N = 1e5 + 6;
long long int modInverse(long long int a, long long int m) {
  long long int m0 = m;
  long long int y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    long long int q = a / m;
    long long int t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
long long int powm(long long int a, long long int b) {
  a = a % mod;
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return (res % mod);
}
long long int arr[N][2];
void solve() {
  string s;
  cin >> s;
  long long int n = s.length();
  long long int val = 0;
  s = s + 'c';
  vector<int> v;
  for (long long int i = 0; i < n;) {
    if (s[i] == 'a') {
      while (i < n && s[i] == 'a') i++;
      v.push_back(i - val);
      val = i;
      if (i == n) break;
    } else {
      while (i < n && s[i] == 'b') i++;
      v.push_back(i - val);
      val = i;
    }
  }
  long long int t = v.size() - 1;
  memset(arr, 0, sizeof(arr));
  arr[t][0] = v[t] / 2;
  arr[t][1] = v[t] - v[t] / 2;
  for (long long int i = t - 1; i >= 0; i--) {
    long long int eve = v[i] / 2;
    long long int odd = v[i] - v[i] / 2;
    long long int val = v[i] + v[i + 1];
    long long int v1 = arr[i + 2][0], v2 = arr[i + 2][1];
    if (val % 2) swap(v1, v2);
    arr[i][0] = eve + v1;
    arr[i][1] = odd + v2;
  }
  long long int an1 = 0, an2 = 0;
  for (long long int i = 0; i <= t; i++) {
    long long int val = v[i];
    long long int eve = val / 2;
    long long int odd = (val + 1) / 2;
    eve = eve * (eve + 1);
    odd = odd * (odd + 1) - odd;
    if (val % 2 == 0) swap(eve, odd);
    an1 += eve;
    an2 += odd;
    if (i != t) {
      long long int val = v[i + 1];
      eve = v[i] / 2;
      odd = v[i] - v[i] / 2;
      long long int v1 = arr[i + 2][0], v2 = arr[i + 2][1];
      if (val % 2) swap(v1, v2);
      an1 += eve * v1 + odd * v2;
      an2 += eve * v2 + odd * v1;
    }
  }
  cout << an1 << ' ' << an2 << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t--) solve();
}
