P26498 [AtCoder] Multiplication Longhand
入门
题目描述

Problem Description

You are learning arithmetic. You want to perform multiplication on two numbers.

In the longhand multiplication method you are learning, to perform multiplication on two numbers, you need to perform multiplication between single-digit numbers exactly (number of digits in A) × (number of digits in B) times.

You are given positive integers A and B. Output the number of single-digit multiplications required when performing longhand multiplication on these two numbers.

Input Format

The input is given from the standard input in the following format:

$ A $ $ B $

  • The first line contains a positive integer $A\ (1≦A≦10^6)$.
  • The second line contains a positive integer $B\ (1≦B≦10^6)$.

Output Format

Output one line, which is the number of single-digit multiplications required when performing the longhand multiplication described in the text. Do not forget the newline at the end.

Sample Input and Output

Sample Input #1

123
12

Sample Output #1

6

Sample Input #2

10
1000

Sample Output #2

8

Sample Input #3

2
3

Sample Output #3

1

Sample Input #4

1000000
1000000

Sample Output #4

49

Notes/Hints

Sample Explanation 1

$ 123 $ is a 3-digit number, and $ 12 $ is a 2-digit number. Therefore, the answer is $ 6(=2×3) $.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
123 12
样例输出
6