#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (b == 0) ? a : gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
long long int modpow(long long int a, long long int n, long long int mod) {
  long long int res = 1;
  while (n) {
    if (n & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    n >>= 1;
  }
  return res;
}
long long int lpow(long long int a, long long int n) {
  long long int res = 1;
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
int h[26];
int H[26];
string s, t;
int vis[200010];
void Scan() {
  cin >> s >> t;
  return;
}
void Out() {
  int res1 = 0, res2 = 0;
  for (int i = 0; i < int((t).size()); i++) {
    if (t[i] >= 'a' && t[i] <= 'z')
      h[t[i] - 'a']++;
    else
      H[t[i] - 'A']++;
  }
  for (int i = 0; i < int((s).size()); i++) {
    if (s[i] >= 'a' && s[i] <= 'z') {
      if (h[s[i] - 'a'] > 0) {
        res1++;
        h[s[i] - 'a']--;
        vis[i] = 1;
      }
    } else {
      if (H[s[i] - 'A'] > 0) {
        res1++;
        H[s[i] - 'A']--;
        vis[i] = 1;
      }
    }
  }
  for (int i = 0; i < int((s).size()); i++) {
    if (vis[i] == 0) {
      if (s[i] >= 'a' && s[i] <= 'z') {
        if (H[s[i] - 'a'] > 0) {
          res2++;
          H[s[i] - 'a']--;
          vis[i] = 1;
        }
      } else {
        if (h[s[i] - 'A'] > 0) {
          res2++;
          h[s[i] - 'A']--;
          vis[i] = 1;
        }
      }
    }
  }
  cout << res1 << " " << res2 << endl;
  return;
}
int main() {
  Scan();
  Out();
  return 0;
}
