Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/shaxmat-donasi-qiymati

Chess piece value

Easy 1000 ms 64 MB 21%
Share

The letter of a chess piece is given. Print its usual value: P (pawn) — $1$, N (knight) — $3$, B (bishop) — $3$, R (rook) — $5$, Q (queen) — $9$, K (king) — $0$ (the king is never traded).

The letters of six chess pieces and their values; the value of the given piece highlighted

Input

One capital Latin letter.

Output

One integer — the value of the piece.

Note

The letter is only P, N, B, R, Q or K.

Examples

Input #1
R
Output #1
5
Input #2
N
Output #2
3

Sign in to submit a solution

Signing up is free and takes a minute.