#include <limits.h>

int main(int argc, char *argv[])
{
  int score_matrix[CHAR_MAX][CHAR_MAX] = {{0}};
  score_matrix['L']['L'] = 4;
  score_matrix['L']['V'] = 1;
  score_matrix['L']['I'] = 2;
  score_matrix['L']['F'] = 0;
  score_matrix['L']['K'] = -2;
  score_matrix['L']['R'] = -2;
  score_matrix['L']['E'] = -3;
  score_matrix['L']['D'] = -4;
  score_matrix['L']['A'] = -1;
  score_matrix['L']['G'] = -4;
  score_matrix['L']['S'] = -2;
  score_matrix['L']['T'] = -1;
  score_matrix['L']['N'] = -3;
  score_matrix['L']['Q'] = -2;
  score_matrix['L']['Y'] = -1;
  score_matrix['L']['W'] = -2;
  score_matrix['L']['P'] = -3;
  score_matrix['L']['H'] = -3;
  score_matrix['L']['M'] = 2;
  score_matrix['L']['C'] = -1;
  score_matrix['L']['X'] = -1;
  score_matrix['V']['L'] = 1;
  score_matrix['V']['V'] = 4;
  score_matrix['V']['I'] = 3;
  score_matrix['V']['F'] = -1;
  score_matrix['V']['K'] = -2;
  score_matrix['V']['R'] = -3;
  score_matrix['V']['E'] = -2;
  score_matrix['V']['D'] = -3;
  score_matrix['V']['A'] = 0;
  score_matrix['V']['G'] = -3;
  score_matrix['V']['S'] = -2;
  score_matrix['V']['T'] = 0;
  score_matrix['V']['N'] = -3;
  score_matrix['V']['Q'] = -2;
  score_matrix['V']['Y'] = -1;
  score_matrix['V']['W'] = -3;
  score_matrix['V']['P'] = -2;
  score_matrix['V']['H'] = -3;
  score_matrix['V']['M'] = 1;
  score_matrix['V']['C'] = -1;
  score_matrix['V']['X'] = -1;
  score_matrix['I']['L'] = 2;
  score_matrix['I']['V'] = 3;
  score_matrix['I']['I'] = 4;
  score_matrix['I']['F'] = 0;
  score_matrix['I']['K'] = -3;
  score_matrix['I']['R'] = -3;
  score_matrix['I']['E'] = -3;
  score_matrix['I']['D'] = -3;
  score_matrix['I']['A'] = -1;
  score_matrix['I']['G'] = -4;
  score_matrix['I']['S'] = -2;
  score_matrix['I']['T'] = -1;
  score_matrix['I']['N'] = -3;
  score_matrix['I']['Q'] = -3;
  score_matrix['I']['Y'] = -1;
  score_matrix['I']['W'] = -3;
  score_matrix['I']['P'] = -3;
  score_matrix['I']['H'] = -3;
  score_matrix['I']['M'] = 1;
  score_matrix['I']['C'] = -1;
  score_matrix['I']['X'] = -1;
  score_matrix['F']['L'] = 0;
  score_matrix['F']['V'] = -1;
  score_matrix['F']['I'] = 0;
  score_matrix['F']['F'] = 6;
  score_matrix['F']['K'] = -3;
  score_matrix['F']['R'] = -3;
  score_matrix['F']['E'] = -3;
  score_matrix['F']['D'] = -3;
  score_matrix['F']['A'] = -2;
  score_matrix['F']['G'] = -3;
  score_matrix['F']['S'] = -2;
  score_matrix['F']['T'] = -2;
  score_matrix['F']['N'] = -3;
  score_matrix['F']['Q'] = -3;
  score_matrix['F']['Y'] = 3;
  score_matrix['F']['W'] = 1;
  score_matrix['F']['P'] = -4;
  score_matrix['F']['H'] = -1;
  score_matrix['F']['M'] = 0;
  score_matrix['F']['C'] = -2;
  score_matrix['F']['X'] = -1;
  score_matrix['K']['L'] = -2;
  score_matrix['K']['V'] = -2;
  score_matrix['K']['I'] = -3;
  score_matrix['K']['F'] = -3;
  score_matrix['K']['K'] = 5;
  score_matrix['K']['R'] = 2;
  score_matrix['K']['E'] = 1;
  score_matrix['K']['D'] = -1;
  score_matrix['K']['A'] = -1;
  score_matrix['K']['G'] = -2;
  score_matrix['K']['S'] = 0;
  score_matrix['K']['T'] = -1;
  score_matrix['K']['N'] = 0;
  score_matrix['K']['Q'] = 1;
  score_matrix['K']['Y'] = -2;
  score_matrix['K']['W'] = -3;
  score_matrix['K']['P'] = -1;
  score_matrix['K']['H'] = -1;
  score_matrix['K']['M'] = -1;
  score_matrix['K']['C'] = -3;
  score_matrix['K']['X'] = -1;
  score_matrix['R']['L'] = -2;
  score_matrix['R']['V'] = -3;
  score_matrix['R']['I'] = -3;
  score_matrix['R']['F'] = -3;
  score_matrix['R']['K'] = 2;
  score_matrix['R']['R'] = 5;
  score_matrix['R']['E'] = 0;
  score_matrix['R']['D'] = -2;
  score_matrix['R']['A'] = -1;
  score_matrix['R']['G'] = -2;
  score_matrix['R']['S'] = -1;
  score_matrix['R']['T'] = -1;
  score_matrix['R']['N'] = 0;
  score_matrix['R']['Q'] = 1;
  score_matrix['R']['Y'] = -2;
  score_matrix['R']['W'] = -3;
  score_matrix['R']['P'] = -2;
  score_matrix['R']['H'] = 0;
  score_matrix['R']['M'] = -1;
  score_matrix['R']['C'] = -3;
  score_matrix['R']['X'] = -1;
  score_matrix['E']['L'] = -3;
  score_matrix['E']['V'] = -2;
  score_matrix['E']['I'] = -3;
  score_matrix['E']['F'] = -3;
  score_matrix['E']['K'] = 1;
  score_matrix['E']['R'] = 0;
  score_matrix['E']['E'] = 5;
  score_matrix['E']['D'] = 2;
  score_matrix['E']['A'] = -1;
  score_matrix['E']['G'] = -2;
  score_matrix['E']['S'] = 0;
  score_matrix['E']['T'] = -1;
  score_matrix['E']['N'] = 0;
  score_matrix['E']['Q'] = 2;
  score_matrix['E']['Y'] = -2;
  score_matrix['E']['W'] = -3;
  score_matrix['E']['P'] = -1;
  score_matrix['E']['H'] = 0;
  score_matrix['E']['M'] = -2;
  score_matrix['E']['C'] = -4;
  score_matrix['E']['X'] = -1;
  score_matrix['D']['L'] = -4;
  score_matrix['D']['V'] = -3;
  score_matrix['D']['I'] = -3;
  score_matrix['D']['F'] = -3;
  score_matrix['D']['K'] = -1;
  score_matrix['D']['R'] = -2;
  score_matrix['D']['E'] = 2;
  score_matrix['D']['D'] = 6;
  score_matrix['D']['A'] = -2;
  score_matrix['D']['G'] = -1;
  score_matrix['D']['S'] = 0;
  score_matrix['D']['T'] = -1;
  score_matrix['D']['N'] = 1;
  score_matrix['D']['Q'] = 0;
  score_matrix['D']['Y'] = -3;
  score_matrix['D']['W'] = -4;
  score_matrix['D']['P'] = -1;
  score_matrix['D']['H'] = -1;
  score_matrix['D']['M'] = -3;
  score_matrix['D']['C'] = -3;
  score_matrix['D']['X'] = -1;
  score_matrix['A']['L'] = -1;
  score_matrix['A']['V'] = 0;
  score_matrix['A']['I'] = -1;
  score_matrix['A']['F'] = -2;
  score_matrix['A']['K'] = -1;
  score_matrix['A']['R'] = -1;
  score_matrix['A']['E'] = -1;
  score_matrix['A']['D'] = -2;
  score_matrix['A']['A'] = 4;
  score_matrix['A']['G'] = 0;
  score_matrix['A']['S'] = 1;
  score_matrix['A']['T'] = 0;
  score_matrix['A']['N'] = -2;
  score_matrix['A']['Q'] = -1;
  score_matrix['A']['Y'] = -2;
  score_matrix['A']['W'] = -3;
  score_matrix['A']['P'] = -1;
  score_matrix['A']['H'] = -2;
  score_matrix['A']['M'] = -1;
  score_matrix['A']['C'] = 0;
  score_matrix['A']['X'] = 0;
  score_matrix['G']['L'] = -4;
  score_matrix['G']['V'] = -3;
  score_matrix['G']['I'] = -4;
  score_matrix['G']['F'] = -3;
  score_matrix['G']['K'] = -2;
  score_matrix['G']['R'] = -2;
  score_matrix['G']['E'] = -2;
  score_matrix['G']['D'] = -1;
  score_matrix['G']['A'] = 0;
  score_matrix['G']['G'] = 6;
  score_matrix['G']['S'] = 0;
  score_matrix['G']['T'] = -2;
  score_matrix['G']['N'] = 0;
  score_matrix['G']['Q'] = -2;
  score_matrix['G']['Y'] = -3;
  score_matrix['G']['W'] = -2;
  score_matrix['G']['P'] = -2;
  score_matrix['G']['H'] = -2;
  score_matrix['G']['M'] = -3;
  score_matrix['G']['C'] = -3;
  score_matrix['G']['X'] = -1;
  score_matrix['S']['L'] = -2;
  score_matrix['S']['V'] = -2;
  score_matrix['S']['I'] = -2;
  score_matrix['S']['F'] = -2;
  score_matrix['S']['K'] = 0;
  score_matrix['S']['R'] = -1;
  score_matrix['S']['E'] = 0;
  score_matrix['S']['D'] = 0;
  score_matrix['S']['A'] = 1;
  score_matrix['S']['G'] = 0;
  score_matrix['S']['S'] = 4;
  score_matrix['S']['T'] = 1;
  score_matrix['S']['N'] = 1;
  score_matrix['S']['Q'] = 0;
  score_matrix['S']['Y'] = -2;
  score_matrix['S']['W'] = -3;
  score_matrix['S']['P'] = -1;
  score_matrix['S']['H'] = -1;
  score_matrix['S']['M'] = -1;
  score_matrix['S']['C'] = -1;
  score_matrix['S']['X'] = 0;
  score_matrix['T']['L'] = -1;
  score_matrix['T']['V'] = 0;
  score_matrix['T']['I'] = -1;
  score_matrix['T']['F'] = -2;
  score_matrix['T']['K'] = -1;
  score_matrix['T']['R'] = -1;
  score_matrix['T']['E'] = -1;
  score_matrix['T']['D'] = -1;
  score_matrix['T']['A'] = 0;
  score_matrix['T']['G'] = -2;
  score_matrix['T']['S'] = 1;
  score_matrix['T']['T'] = 5;
  score_matrix['T']['N'] = 0;
  score_matrix['T']['Q'] = -1;
  score_matrix['T']['Y'] = -2;
  score_matrix['T']['W'] = -2;
  score_matrix['T']['P'] = -1;
  score_matrix['T']['H'] = -2;
  score_matrix['T']['M'] = -1;
  score_matrix['T']['C'] = -1;
  score_matrix['T']['X'] = 0;
  score_matrix['N']['L'] = -3;
  score_matrix['N']['V'] = -3;
  score_matrix['N']['I'] = -3;
  score_matrix['N']['F'] = -3;
  score_matrix['N']['K'] = 0;
  score_matrix['N']['R'] = 0;
  score_matrix['N']['E'] = 0;
  score_matrix['N']['D'] = 1;
  score_matrix['N']['A'] = -2;
  score_matrix['N']['G'] = 0;
  score_matrix['N']['S'] = 1;
  score_matrix['N']['T'] = 0;
  score_matrix['N']['N'] = 6;
  score_matrix['N']['Q'] = 0;
  score_matrix['N']['Y'] = -2;
  score_matrix['N']['W'] = -4;
  score_matrix['N']['P'] = -2;
  score_matrix['N']['H'] = 1;
  score_matrix['N']['M'] = -2;
  score_matrix['N']['C'] = -3;
  score_matrix['N']['X'] = -1;
  score_matrix['Q']['L'] = -2;
  score_matrix['Q']['V'] = -2;
  score_matrix['Q']['I'] = -3;
  score_matrix['Q']['F'] = -3;
  score_matrix['Q']['K'] = 1;
  score_matrix['Q']['R'] = 1;
  score_matrix['Q']['E'] = 2;
  score_matrix['Q']['D'] = 0;
  score_matrix['Q']['A'] = -1;
  score_matrix['Q']['G'] = -2;
  score_matrix['Q']['S'] = 0;
  score_matrix['Q']['T'] = -1;
  score_matrix['Q']['N'] = 0;
  score_matrix['Q']['Q'] = 5;
  score_matrix['Q']['Y'] = -1;
  score_matrix['Q']['W'] = -2;
  score_matrix['Q']['P'] = -1;
  score_matrix['Q']['H'] = 0;
  score_matrix['Q']['M'] = 0;
  score_matrix['Q']['C'] = -3;
  score_matrix['Q']['X'] = -1;
  score_matrix['Y']['L'] = -1;
  score_matrix['Y']['V'] = -1;
  score_matrix['Y']['I'] = -1;
  score_matrix['Y']['F'] = 3;
  score_matrix['Y']['K'] = -2;
  score_matrix['Y']['R'] = -2;
  score_matrix['Y']['E'] = -2;
  score_matrix['Y']['D'] = -3;
  score_matrix['Y']['A'] = -2;
  score_matrix['Y']['G'] = -3;
  score_matrix['Y']['S'] = -2;
  score_matrix['Y']['T'] = -2;
  score_matrix['Y']['N'] = -2;
  score_matrix['Y']['Q'] = -1;
  score_matrix['Y']['Y'] = 7;
  score_matrix['Y']['W'] = 2;
  score_matrix['Y']['P'] = -3;
  score_matrix['Y']['H'] = 2;
  score_matrix['Y']['M'] = -1;
  score_matrix['Y']['C'] = -2;
  score_matrix['Y']['X'] = -1;
  score_matrix['W']['L'] = -2;
  score_matrix['W']['V'] = -3;
  score_matrix['W']['I'] = -3;
  score_matrix['W']['F'] = 1;
  score_matrix['W']['K'] = -3;
  score_matrix['W']['R'] = -3;
  score_matrix['W']['E'] = -3;
  score_matrix['W']['D'] = -4;
  score_matrix['W']['A'] = -3;
  score_matrix['W']['G'] = -2;
  score_matrix['W']['S'] = -3;
  score_matrix['W']['T'] = -2;
  score_matrix['W']['N'] = -4;
  score_matrix['W']['Q'] = -2;
  score_matrix['W']['Y'] = 2;
  score_matrix['W']['W'] = 11;
  score_matrix['W']['P'] = -4;
  score_matrix['W']['H'] = -2;
  score_matrix['W']['M'] = -1;
  score_matrix['W']['C'] = -2;
  score_matrix['W']['X'] = -2;
  score_matrix['P']['L'] = -3;
  score_matrix['P']['V'] = -2;
  score_matrix['P']['I'] = -3;
  score_matrix['P']['F'] = -4;
  score_matrix['P']['K'] = -1;
  score_matrix['P']['R'] = -2;
  score_matrix['P']['E'] = -1;
  score_matrix['P']['D'] = -1;
  score_matrix['P']['A'] = -1;
  score_matrix['P']['G'] = -2;
  score_matrix['P']['S'] = -1;
  score_matrix['P']['T'] = -1;
  score_matrix['P']['N'] = -2;
  score_matrix['P']['Q'] = -1;
  score_matrix['P']['Y'] = -3;
  score_matrix['P']['W'] = -4;
  score_matrix['P']['P'] = 7;
  score_matrix['P']['H'] = -2;
  score_matrix['P']['M'] = -2;
  score_matrix['P']['C'] = -3;
  score_matrix['P']['X'] = -2;
  score_matrix['H']['L'] = -3;
  score_matrix['H']['V'] = -3;
  score_matrix['H']['I'] = -3;
  score_matrix['H']['F'] = -1;
  score_matrix['H']['K'] = -1;
  score_matrix['H']['R'] = 0;
  score_matrix['H']['E'] = 0;
  score_matrix['H']['D'] = -1;
  score_matrix['H']['A'] = -2;
  score_matrix['H']['G'] = -2;
  score_matrix['H']['S'] = -1;
  score_matrix['H']['T'] = -2;
  score_matrix['H']['N'] = 1;
  score_matrix['H']['Q'] = 0;
  score_matrix['H']['Y'] = 2;
  score_matrix['H']['W'] = -2;
  score_matrix['H']['P'] = -2;
  score_matrix['H']['H'] = 8;
  score_matrix['H']['M'] = -2;
  score_matrix['H']['C'] = -3;
  score_matrix['H']['X'] = -1;
  score_matrix['M']['L'] = 2;
  score_matrix['M']['V'] = 1;
  score_matrix['M']['I'] = 1;
  score_matrix['M']['F'] = 0;
  score_matrix['M']['K'] = -1;
  score_matrix['M']['R'] = -1;
  score_matrix['M']['E'] = -2;
  score_matrix['M']['D'] = -3;
  score_matrix['M']['A'] = -1;
  score_matrix['M']['G'] = -3;
  score_matrix['M']['S'] = -1;
  score_matrix['M']['T'] = -1;
  score_matrix['M']['N'] = -2;
  score_matrix['M']['Q'] = 0;
  score_matrix['M']['Y'] = -1;
  score_matrix['M']['W'] = -1;
  score_matrix['M']['P'] = -2;
  score_matrix['M']['H'] = -2;
  score_matrix['M']['M'] = 5;
  score_matrix['M']['C'] = -1;
  score_matrix['M']['X'] = -1;
  score_matrix['C']['L'] = -1;
  score_matrix['C']['V'] = -1;
  score_matrix['C']['I'] = -1;
  score_matrix['C']['F'] = -2;
  score_matrix['C']['K'] = -3;
  score_matrix['C']['R'] = -3;
  score_matrix['C']['E'] = -4;
  score_matrix['C']['D'] = -3;
  score_matrix['C']['A'] = 0;
  score_matrix['C']['G'] = -3;
  score_matrix['C']['S'] = -1;
  score_matrix['C']['T'] = -1;
  score_matrix['C']['N'] = -3;
  score_matrix['C']['Q'] = -3;
  score_matrix['C']['Y'] = -2;
  score_matrix['C']['W'] = -2;
  score_matrix['C']['P'] = -3;
  score_matrix['C']['H'] = -3;
  score_matrix['C']['M'] = -1;
  score_matrix['C']['C'] = 9;
  score_matrix['C']['X'] = -2;
  score_matrix['X']['L'] = -1;
  score_matrix['X']['V'] = -1;
  score_matrix['X']['I'] = -1;
  score_matrix['X']['F'] = -1;
  score_matrix['X']['K'] = -1;
  score_matrix['X']['R'] = -1;
  score_matrix['X']['E'] = -1;
  score_matrix['X']['D'] = -1;
  score_matrix['X']['A'] = 0;
  score_matrix['X']['G'] = -1;
  score_matrix['X']['S'] = 0;
  score_matrix['X']['T'] = 0;
  score_matrix['X']['N'] = -1;
  score_matrix['X']['Q'] = -1;
  score_matrix['X']['Y'] = -1;
  score_matrix['X']['W'] = -2;
  score_matrix['X']['P'] = -2;
  score_matrix['X']['H'] = -1;
  score_matrix['X']['M'] = -1;
  score_matrix['X']['C'] = -2;
  score_matrix['X']['X'] = -1;
  return 0;
}
