#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n;
long long ev, od, f[N][2][4];
char s[N];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  f[1][1][s[1] == 'b'] = od = 1;
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j <= 1; j++) {
      if (s[i] == 'a') {
        f[i][j][0] = f[i - 1][j ^ 1][0] + f[i - 1][j ^ 1][2] + (j == 1);
        f[i][j][3] = f[i - 1][j ^ 1][1] + f[i - 1][j ^ 1][3];
      } else {
        f[i][j][1] = f[i - 1][j ^ 1][1] + f[i - 1][j ^ 1][3] + (j == 1);
        f[i][j][2] = f[i - 1][j ^ 1][0] + f[i - 1][j ^ 1][2];
      }
    }
    ev += f[i][0][0] + f[i][0][1];
    od += f[i][1][0] + f[i][1][1];
  }
  printf("%lld %lld\n", ev, od);
  return 0;
}
