#abc305b. [abc305_b]ABCDEFG
[abc305_b]ABCDEFG
Problem Statement
There are points , , , , , , and on a straight line, in this order. (See also the figure below.)
The distances between adjacent points are as follows.
- Between and :
- Between and :
- Between and :
- Between and :
- Between and :
- Between and :
You are given two uppercase English letters and . Each of and is A
, B
, C
, D
, E
, F
, or G
, and it holds that .
Find the distance between the points and .
Constraints
- Each of and is
A
,B
,C
,D
,E
,F
, orG
.
Input
The input is given from Standard Input in the following format:
Output
Print the distance between the points and .
Sample Input 1
A C
Sample Output 1
4
The distance between the points and is .
Sample Input 2
G B
Sample Output 2
20
The distance between the points and is .
Sample Input 3
C F
Sample Output 3
10