#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const ll inf = 1;
const ll mod = 1E9;
int cnt[400];
int f[2 * 100010];
int main() {
  string s, t;
  while (cin >> s >> t) {
    memset(f, 0, sizeof(f));
    for (int i = 0; i < (int)t.size(); i++) {
      cnt[t[i]]++;
    }
    int a = 0, b = 0;
    for (int i = 0; i < (int)s.size(); i++) {
      if (cnt[s[i]]) {
        cnt[s[i]]--;
        a++;
        f[i] = 1;
      }
    }
    for (int i = 0; i < (int)s.size(); i++) {
      if (!f[i]) {
        char ch = (s[i] == toupper(s[i])) ? tolower(s[i]) : toupper(s[i]);
        if (cnt[ch]) {
          cnt[ch]--;
          b++;
        }
      }
    }
    cout << a << ' ' << b << '\n';
  }
  return 0;
}
