#include <stdio.h>
int main() {
int a, b;
scanf("%d %d", &a, &b);
int ca = a, cb = b, nrcifa = 0, nrcifb = 0;
while(ca > 0) {
nrcifa++;
ca = ca / 10;
}
while(cb > 0) {
nrcifb++;
cb = cb / 10;
}
if(nrcifa != nrcifb)
printf("NU");
else {
printf("DA\n");
int nrcif = 0;
while(a > 0) {
if(a % 10 == b % 10)
nrcif++;
b = b / 10;
a = a / 10;
}
printf("%d", nrcif);
}
return 0;
}