#include <iostream>
using namespace std;
int main()
{
int a, b, nca=1, ncb=1, ap=0;
cin >> a >> b;
int copiea=a;
while (copiea>9) { ++nca; copiea/=10; }
int copieb=b;
while (copieb>9) { ++ncb; copieb/=10; }
if (nca!=ncb) cout << "NU";
else
{
cout << "DA" << "\n";
if (a==0) { if (b==0) cout << 1;
else cout << 0;}
else {
if (b==0) cout << 0;
else {
while (a && b)
{
if (a%10==b%10) ++ap;
a=a/10; b=b/10;
}
cout << ap; }
}
}
return 0;
}