#include <bits/stdc++.h>
using namespace std;
char buf[2048], *_s = buf + 2048;
inline char getc1(void) {
  if (_s >= buf + 2048) {
    fread(buf, 1, 2048, stdin);
    _s = buf;
  }
  return *(_s++);
}
inline int readint() {
  char t = getc1();
  int n = 1, res = 0;
  while (t != '-' && !isdigit(t)) t = getc1();
  if (t == '-') {
    n = -1;
    t = getc1();
  }
  while (isdigit(t)) {
    res = 10 * res + (t & 15);
    t = getc1();
  }
  return res * n;
}
inline long long readLL() {
  char t = getc1();
  int n = 1;
  long long res = 0;
  while (t != '-' && !isdigit(t)) t = getc1();
  if (t == '-') {
    n = -1;
    t = getc1();
  }
  while (isdigit(t)) {
    res = 10 * res + (t & 15);
    t = getc1();
  }
  return res * n;
}
inline char skipwhitespace() {
  char ch = getc1();
  while (ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t') ch = getc1();
  return ch;
}
inline int readline(char *s) {
  char ch = skipwhitespace();
  int n = 0;
  while ((ch != '\n')) {
    s[n++] = ch;
    ch = getc1();
  }
  s[n] = 0;
  return n;
}
inline int readstr(char *s) {
  char ch = skipwhitespace();
  int n = 0;
  while ((ch != '\n' && ch != ' ' && ch != '\t')) {
    s[n++] = ch;
    ch = getc1();
  }
  s[n] = 0;
  return n;
}
inline char readchar() { return skipwhitespace(); }
char outbuf[2048];
int outbuf_p;
inline void putc1(char ch) {
  if (outbuf_p >= 2048) {
    fwrite(outbuf, 1, 2048, stdout);
    outbuf_p = 0;
  }
  outbuf[outbuf_p++] = ch;
}
inline void flush() {
  fwrite(outbuf, 1, outbuf_p, stdout);
  outbuf_p = 0;
}
inline void writeint(int n) {
  int sign = n >= 0 ? 1 : -1;
  n = n > 0 ? n : -n;
  char buf[10];
  int i = 9;
  if (!n) buf[i--] = 48;
  while (n) {
    buf[i--] = n % 10 + 48;
    n /= 10;
  }
  if (sign < 0) putc1('-');
  while (++i < 10) putc1(buf[i]);
}
inline void writeLL(long long n) {
  int sign = n >= 0 ? 1 : -1;
  n = n > 0 ? n : -n;
  char buf[25];
  int i = 24;
  if (!n) buf[i--] = 48;
  while (n) {
    buf[i--] = n % 10 + 48;
    n /= 10;
  }
  if (sign < 0) putc1('-');
  while (++i < 25) putc1(buf[i]);
}
inline void writestr(char *s) {
  char *p = s;
  while (*p) {
    putc1(*p);
    p++;
  }
}
inline void writedouble(double d, int p) {
  char buf[40];
  sprintf(buf, "%.*f", p, d);
  writestr(buf);
}
long long pow1(long long b, long long e, long long mod) {
  if (e == 0) return 1;
  long long ans = pow1(b, e / 2, mod);
  ans = (ans * ans) % mod;
  if (e & 1)
    return (ans * b) % mod;
  else
    return ans;
}
inline long long pow(long long b, long long e, long long mod) {
  if (e < 0)
    return pow1(pow1(b, -e, mod), mod - 2, mod);
  else
    return pow1(b, e, mod);
}
long long egcd(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  long long d = egcd(b % a, a, x1, y1);
  x = y1 - x1 * (b / a);
  y = x1;
  return d;
}
long long inv(long long a, long long m) {
  long long inv, y;
  assert(egcd(a, m, inv, y) == 1);
  if (inv < 0) inv += m;
  return inv;
}
long long gcd(long long a, long long b) {
  return !a || !b ? a + b : gcd(b, a % b);
}
inline int getbit(long long n, int i) { return n & (1 << i); }
char s[200001], t[200001];
int main() {
  gets(s);
  gets(t);
  int s_n = strlen(s);
  int t_n = strlen(t);
  int upper[2][26], lower[2][26];
  memset(upper, 0, sizeof(upper));
  memset(lower, 0, sizeof(lower));
  for (int a = 0; a < t_n; a++) {
    if (t[a] <= 90)
      upper[1][t[a] - 65]++;
    else if (t[a] >= 97)
      lower[1][t[a] - 97]++;
  }
  for (int a = 0; a < s_n; a++) {
    if (s[a] <= 90)
      upper[0][s[a] - 'A']++;
    else if (s[a] >= 97)
      lower[0][s[a] - 'a']++;
  }
  int ans1 = 0, ans2 = 0, k = 0;
  for (int a = 0; a < 26 and k < s_n; a++) {
    int m = min(lower[0][a], lower[1][a]);
    lower[0][a] -= m;
    lower[1][a] -= m;
    k += m;
  }
  for (int a = 0; a < 26 and k < s_n; a++) {
    int m = min(upper[0][a], upper[1][a]);
    upper[0][a] -= m;
    upper[1][a] -= m;
    k += m;
  }
  for (int a = 0; a < 26; a++) {
    int m1 = min(upper[0][a], lower[1][a]);
    int m2 = min(lower[0][a], upper[1][a]);
    if (m1 > m2) {
      ans2 += m1;
      upper[0][a] -= m1;
      lower[1][a] -= m1;
    } else {
      ans2 += m2;
      lower[0][a] -= m2;
      upper[1][a] -= m2;
    }
  }
  printf("%d %d\n", k, ans2);
  return 0;
}
