#include<iostream>
#include<vector>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
int main(){
    string s,t;
    while(cin >> s >> t, s != "0"){
        int x = 0, y = 0;
        int a[10] = {}, b[10] = {};
        rep(i,4){
            if(s[i] == t[i])x++;
            else{
                a[s[i]-'0']++;
                b[t[i]-'0']++;
            }
        }
        rep(i,10)y += min(a[i],b[i]);
        cout << x << " " << y << endl;
    }
}

