시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 4 4 3 100.000%

문제

Young magician Glingul has discovered in the library a secret scroll that has strangely written text on it. Words without meaning are written as combinations of letters and digits. Glingul quickly found out that every letter w, e, n or s is followed by a sequence of digits. Other side of this mysterious scroll contains a square divided into smaller squares. On the top of this map is letter n, on the bottom s, on the left w and on the right e. One of those squares is colored in red and Glingul determined that this is the location of his school. Now it was easy to understand that the scroll describes a path starting from the red square where each move is a number of steps in one of the four specified directions. A number is defined as sequence of digits. All other characters are ignored. Write a program that finds the distance between centers of the red square and the last square on the described path. Side of the small square tile is 1. Digits following the letters form numbers between 1 and 99.

입력

The input contains a sequence of characters (less than 80) representing the line of strange text.

출력

The output should contain the distance, rounded to two decimal digits.

예제 입력 1

On7 the12 s3ob66un2d of the4 be5cc

예제 출력 1

21.84