#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++) {
if (strchr(word_2, word_1[j])) {
*strchr(word_2, word_1[j]) = '#';
matchingLetters++;
}
}
cout << "Case #" << i + 1 << ": " << strlen(word_1) + strlen(word_2) - 2 * matchingLetters << endl;
}
return 0;
}
I2luY2x1ZGUgPGNzdHJpbmc+CiNpbmNsdWRlIDxpb3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0IHNob3J0IG1heFNpemUgPSA0NjsKCmludCBtYWluKCkgewoJaW50IG4sIG1hdGNoaW5nTGV0dGVyczsKCWNpbiA+PiBuOwoJY2luLmlnbm9yZSgpOwoJY2hhciAqd29yZF8xID0gbmV3IGNoYXJbbWF4U2l6ZV07IAoJY2hhciAqd29yZF8yID0gbmV3IGNoYXJbbWF4U2l6ZV07Cglmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewoJCSBtYXRjaGluZ0xldHRlcnMgPSAwOwoJCSBjaW4uZ2V0bGluZSh3b3JkXzEsIG1heFNpemUpOwoJCSBjaW4uZ2V0bGluZSh3b3JkXzIsIG1heFNpemUpOwoJCSBmb3IgKGludCBqID0gMDsgaiA8IHN0cmxlbih3b3JkXzEpOyBqKyspIHsKCQkgCSAgaWYgKHN0cmNocih3b3JkXzIsIHdvcmRfMVtqXSkpIHsKCQkgCSAgCSAgICpzdHJjaHIod29yZF8yLCB3b3JkXzFbal0pID0gJyMnOwoJCSAJICAJICAgbWF0Y2hpbmdMZXR0ZXJzKys7CgkJIAkgIH0KCQkgfQoJCSBjb3V0IDw8ICJDYXNlICMiIDw8IGkgKyAxIDw8ICI6ICAiIDw8IHN0cmxlbih3b3JkXzEpICsgc3RybGVuKHdvcmRfMikgLSAyICogbWF0Y2hpbmdMZXR0ZXJzIDw8IGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==