#include <bits/stdc++.h>
int process_input(int *alphabet_count) {
  int total_read = 0;
  char buffer;
  int *small_alpha = alphabet_count + 26;
  while (1) {
    buffer = fgetc(stdin);
    if (buffer >= 'A' && buffer <= 'Z') ++alphabet_count[buffer - 'A'];
    if (buffer >= 'a' && buffer <= 'z') ++small_alpha[buffer - 'a'];
    ++total_read;
    if (total_read > (2 * 100000) + 1) return -1;
    if (buffer == '\0' || buffer == '\n') {
      break;
    }
  }
  return 0;
}
int main() {
  static int msg_alphabets[52];
  static int paper_alphabets[52];
  int yay = 0;
  int woops = 0;
  int i = 0;
  int j;
  if (process_input(msg_alphabets)) return -1;
  if (process_input(paper_alphabets)) return -1;
  for (i = 0, j = 26; i < 26; i++, j++) {
    if (msg_alphabets[i] <= paper_alphabets[i]) {
      yay += msg_alphabets[i];
      paper_alphabets[i] -= msg_alphabets[i];
      msg_alphabets[i] = 0;
    } else if (msg_alphabets[i]) {
      yay += paper_alphabets[i];
      msg_alphabets[i] -= paper_alphabets[i];
      paper_alphabets[i] = 0;
    }
    if (msg_alphabets[j] <= paper_alphabets[j]) {
      yay += msg_alphabets[j];
      paper_alphabets[j] -= msg_alphabets[j];
      msg_alphabets[j] = 0;
    } else if (msg_alphabets[j]) {
      yay += paper_alphabets[j];
      msg_alphabets[j] -= paper_alphabets[j];
      paper_alphabets[j] = 0;
    }
    woops += (msg_alphabets[i] + msg_alphabets[j]) <
                     (paper_alphabets[i] + paper_alphabets[j])
                 ? (msg_alphabets[i] + msg_alphabets[j])
                 : (paper_alphabets[i] + paper_alphabets[j]);
  }
  printf("%d %d\n", yay, woops);
  return 0;
}
