#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
template <typename T>
inline T sqr(T n) {
  return n * n;
}
vector<ll> get_factors(ll n) {
  vector<ll> f;
  if (n < 2) return f;
  if (n % 2 == 0) f.push_back(2), n /= 2;
  while (n % 2 == 0) n /= 2;
  for (ll x = 3; x * x <= n; x += 2) {
    if (n % x == 0) f.push_back(x), n /= x;
    while (n % x == 0) n /= x;
  }
  if (n > 1) f.push_back(n);
  return f;
}
void solve(int CASE) {
  string s, t;
  cin >> s >> t;
  map<char, int> a;
  for (char ch : s) a[ch]++;
  map<char, int> b;
  for (char ch : t) b[ch]++;
  int yay = 0, whoops = 0;
  for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++) {
    if (it->second) {
      int got = min(b[it->first], it->second);
      yay += got;
      b[it->first] -= got;
      it->second -= got;
    }
  }
  for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++) {
    if (it->second) {
      char ch = isupper(it->first) ? tolower(it->first) : toupper(it->first);
      int got = min(b[ch], it->second);
      whoops += got;
      it->second -= got;
      b[ch] = max(0, b[ch] - got);
    }
  }
  cout << yay << " " << whoops << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 1;
  for (int i = 0; i != t; i++) solve(i + 1);
  return 0;
}
