#include <stdio.h>

int main() {
    int a, n;
    scanf("%d %d", &a, &n);

    int num = 0;
    int i;
    long long sum = 0;
    
    for (i = 0; i < n; i++) {
        num = num * 10 + a;
        sum += num;
    }

    printf("%lld\n", sum);
    
    return 0;
}
