#include <cstring>
#include <iostream>
using namespace std;
const short maxSize = 46;
int main() {
int n, matchingLetters;
cin >> n;
cin.ignore();
char *word_1 = new char[maxSize];
char *word_2 = new char[maxSize];
for (int i = 0; i < n; i++) {
matchingLetters = 0;
cin.getline(word_1, maxSize);
cin.getline(word_2, maxSize);
for (int j = 0; j < strlen(word_1); j++) {
for (int k = 0; k < strlen(word_2); k++) {
if (word_1[j] == word_2[k]) {
word_2[k] = '#';
matchingLetters++;
break;
}
}
}
cout << "Case #" << i + 1 << ": " << strlen(word_1) + strlen(word_2) - 2 * matchingLetters << endl;
}
return 0;
}
I2luY2x1ZGUgPGNzdHJpbmc+CiNpbmNsdWRlIDxpb3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0IHNob3J0IG1heFNpemUgPSA0NjsKCmludCBtYWluKCkgewoJaW50IG4sIG1hdGNoaW5nTGV0dGVyczsKCWNpbiA+PiBuOwoJY2luLmlnbm9yZSgpOwoJY2hhciAqd29yZF8xID0gbmV3IGNoYXJbbWF4U2l6ZV07IAoJY2hhciAqd29yZF8yID0gbmV3IGNoYXJbbWF4U2l6ZV07Cglmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewoJCSBtYXRjaGluZ0xldHRlcnMgPSAwOwoJCSBjaW4uZ2V0bGluZSh3b3JkXzEsIG1heFNpemUpOwoJCSBjaW4uZ2V0bGluZSh3b3JkXzIsIG1heFNpemUpOwoJCSBmb3IgKGludCBqID0gMDsgaiA8IHN0cmxlbih3b3JkXzEpOyBqKyspIHsKCQkgCSAgZm9yIChpbnQgayA9IDA7IGsgPCBzdHJsZW4od29yZF8yKTsgaysrKSAgewoJCSAJICAJICAgaWYgKHdvcmRfMVtqXSA9PSB3b3JkXzJba10pIHsKCQkgCSAgCSAgIAkgICB3b3JkXzJba10gPSAnIyc7CgkJIAkgIAkgICAgICAgbWF0Y2hpbmdMZXR0ZXJzKys7CgkJIAkgIAkgICAgICAgYnJlYWs7CgkJIAkgIAkgICB9CgkJIAkgIH0KCQkgfQoJCSBjb3V0IDw8ICJDYXNlICMiIDw8IGkgKyAxIDw8ICI6ICAiIDw8IHN0cmxlbih3b3JkXzEpICsgc3RybGVuKHdvcmRfMikgLSAyICogbWF0Y2hpbmdMZXR0ZXJzIDw8IGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==