#include <bits/stdc++.h>
using namespace std;
long long po(long long a, long long b) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2) {
      x = x * y;
      x %= 1000000007;
    }
    y = y * y;
    y %= 1000000007;
    b /= 2;
  }
  return x;
}
int main() {
  if (0) {
    freopen("C:/Users/gold/Desktop/sublime IO/input.txt", "r", stdin);
    freopen("C:/Users/gold/Desktop/sublime IO/output.txt", "w", stdout);
  }
  int T = 1;
  while (T--) {
    string s, s1;
    cin >> s >> s1;
    int n = s.length();
    static int cnt[256];
    for (int i = 0; i < n; i++) {
      cnt[s[i]]++;
    }
    int m = s1.length();
    int ans = 0, ans1 = 0;
    for (int i = 0; i < m; i++) {
      if (cnt[s1[i]] > 0) {
        cnt[s1[i]]--;
        ans++;
        s1[i] = '1';
      }
    }
    for (int i = 0; i < m; i++) {
      if (s1[i] == '1') {
        continue;
      }
      if (s1[i] >= 'a' && cnt[s1[i] - 'a' + 'A'] > 0) {
        ans1++;
        cnt[s1[i] - 'a' + 'A']--;
      } else if (cnt[s1[i] - 'A' + 'a'] > 0) {
        ans1++;
        cnt[s1[i] - 'A' + 'a']--;
      }
    }
    printf("%d %d\n", ans, ans1);
  }
  return 0;
}
