#include <iostream>
#include <sstream>
#include <string>

int a[4], b[4];

void split(std::string s, std::string t) {
    a[0] = s[0]-'0'; b[0] = t[0]-'0';
    a[1] = s[2]-'0'; b[1] = t[2]-'0';
    a[2] = s[4]-'0'; b[2] = t[4]-'0';
    a[3] = s[6]-'0'; b[3] = t[6]-'0';
}

void solve() {
    int hit=0, blow=0;
    for (int i=0; i<4; i++) {
        for (int j=0; j<4; j++) {
            if (a[i] == b[j]) {
                if (i == j) {
                    hit++;
                } else {
                    blow++;
                }
            }
        }
    }
    std::cout << hit << ' ' << blow << std::endl;
}

int main(void) {
    std::string line_1, line_2;
    while (std::getline(std::cin, line_1)) {
        std::getline(std::cin, line_2);
        split(line_1, line_2);
        solve();
    }
}

