#include <stdio.h>
// 计算字符串长度:
int Length(char a[])
{
    int n = 0;
    for (int i = 0; a[i] != '\0'; i++)
    {
        n++;
    }
    return n;
}
int main() {
    char Arr[9] = "";
    char Brr[9] = "";
    while ((scanf("%s%s", Arr, Brr)) != EOF) {
        int sum = 0;
        int p = Length(Arr);
        int q = Length(Brr);
        for (int i = 0; i < p; i++) {
            for (int j = 0; j < q; j++) {
                sum += (Arr[i] - '0') * (Brr[j] - '0');
            }
        }
        printf("%d\n", sum);
    }
    return 0;
}