P6315 [COCI 2006/2007 #3] NPUZZLE
Description

You are given a $4 \times 4$ grid board. It contains the $15$ letters $A \sim O$ and one `.` (which represents the empty cell). The standard positions of the letters are shown in the figure.
Now you are given a scrambled board. You need to compute the sum of the [Manhattan distance](https://baike.baidu.com/item/%E6%9B%BC%E5%93%88%E9%A1%BF%E8%B7%9D%E7%A6%BB/743092?fr=aladdin) from each letter’s current position to its standard position.
Input Format
There are $4$ lines of input, and each line contains $4$ characters describing the board.
Output Format
Output one line with one integer, which is the sum of the [Manhattan distance](https://baike.baidu.com/item/%E6%9B%BC%E5%93%88%E9%A1%BF%E8%B7%9D%E7%A6%BB/743092?fr=aladdin) from each letter’s current position to its standard position.
Explanation/Hint
#### Explanation
**This problem is translated from [COCI2006-2007](https://hsin.hr/coci/archive/2006_2007/) [CONTEST #3](https://hsin.hr/coci/archive/2006_2007/contest3_tasks.pdf) *T2 NPUZZLE***
Translated by ChatGPT 5