atcoder#ABC305B. [ABC305B] ABCDEFG

[ABC305B] ABCDEFG

Score : 200200 points

Problem Statement

There are 77 points AA, BB, CC, DD, EE, FF, and GG on a straight line, in this order. (See also the figure below.) The distances between adjacent points are as follows.

  • Between AA and BB: 33
  • Between BB and CC: 11
  • Between CC and DD: 44
  • Between DD and EE: 11
  • Between EE and FF: 55
  • Between FF and GG: 99

image

You are given two uppercase English letters pp and qq. Each of pp and qq is A, B, C, D, E, F, or G, and it holds that pqp \neq q. Find the distance between the points pp and qq.

Constraints

  • Each of pp and qq is A,B,C,D,E,F, or G.
  • pqp \neq q

Input

The input is given from Standard Input in the following format:

pp qq

Output

Print the distance between the points pp and qq.

A C
4

The distance between the points AA and CC is 3+1=43 + 1 = 4.

G B
20

The distance between the points GG and BB is 9+5+1+4+1=209 + 5 + 1 + 4 + 1 = 20.

C F
10