#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const long long infLL = 9000000000000000000;
inline bool checkBit(long long n, int i) { return n & (1LL << i); }
inline long long setBit(long long n, int i) {
  return n | (1LL << i);
  ;
}
inline long long resetBit(long long n, int i) { return n & (~(1LL << i)); }
int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline bool isLeapYear(long long year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}
inline void normal(long long &a) {
  a %= 1000000007;
  (a < 0) && (a += 1000000007);
}
inline void mood(long long &x) {
  if (x < 0) x += 1000000007;
  if (x >= 1000000007) x -= 1000000007;
}
inline long long modMul(long long a, long long b) {
  normal(a);
  normal(b);
  a *= b;
  normal(a);
  return a;
}
inline long long modAdd(long long a, long long b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  return (a + b) % 1000000007;
}
inline long long modSub(long long a, long long b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline long long modPow(long long b, long long p) {
  long long r = 1;
  while (p) {
    if (p & 1) r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1;
  }
  return r;
}
inline long long modInverse(long long a) { return modPow(a, 1000000007 - 2); }
inline long long modDiv(long long a, long long b) {
  return modMul(a, modInverse(b));
}
inline long long power(long long bs, long long k) {
  long long x = 1LL, y = bs;
  if (k == 0) return 1LL;
  while (k > 0) {
    if (k % 2) x *= y;
    y *= y;
    k /= 2;
  }
  return x;
}
string s;
map<int, int> mp;
int cnt[200100], cntc[200100], n;
int main() {
  ios_base::sync_with_stdio(0);
  ;
  cout.unsetf(ios::floatfield);
  cout.precision(10);
  cout.setf(ios::fixed, ios::floatfield);
  ;
  int i, j, v[5] = {0, 4, 8, 14, 20};
  for (i = 0; i < 5; ++i) {
    mp[65 + v[i]] = true;
    mp[97 + v[i]] = true;
  }
  cin >> s;
  n = (int)s.size();
  cnt[0] = 0;
  for (i = 1; i <= n; ++i) {
    if (mp[s[i - 1]])
      cnt[i] = cnt[i - 1] - 1;
    else
      cnt[i] = cnt[i - 1] + 2;
  }
  cntc[n] = cnt[n];
  for (i = n - 1; i > 0; --i) {
    cntc[i] = max(cnt[i], cntc[i + 1]);
  }
  int mx = -inf, pv = -inf;
  j = 1;
  for (i = 0; i <= n; ++i) {
    if (cnt[i] >= pv && mx != -inf) continue;
    for (; j <= n; ++j) {
      if (cntc[j] < cnt[i]) break;
    }
    if (j - i - 1 > 0) mx = max(j - i - 1, mx);
    if (j > n) break;
    pv = cnt[i];
  }
  if (mx == -inf) {
    cout << "No solution";
    return 0;
  }
  int ans = 0;
  for (i = 0; i <= n - mx; ++i) {
    if (cnt[i + mx] - cnt[i] >= 0) ++ans;
  }
  cout << mx << ' ' << ans;
  return 0;
}
