#include <iostream> #include<string> using namespace std; int trans(char a) { int temp = a - '0'; return temp; } int main() { string s1, s2; while (cin >> s1 >> s2) { int temp = 0; int num1 = s1.size(); int num2 = s2.size(); for (int i = 0; i < num1; i++) { for (int j = 0; j < num2; j++) { temp += trans(s1[i]) * trans(s2[j]); } } cout << temp << endl; } }