#include <stdio.h>
#include <string.h>
#include <ctype.h>

enum piece_type
{
	PAWN,KNIGHT,BISHOP,ROOK,QUEEN,KING
};

enum piece_type board[8][8];

//Each side's scores, initialized to their scores at the start of a
//standard chess match.
int score_white = 39;
int score_black = 39;

//Maximum input buffer size. This should be plenty.
const int BUFSIZE = 128;

int get_file_num(char file)
{
	return file - (int)'a';
}

//Just a simple way to get the rank number.
int get_rank_num(char rank)
{
	return rank - (int)'1';
}

//Get the piece type, based on the character. Uses the gcc range
//extension to simplify the pawn case.
enum piece_type get_piece_type(char pt)
{
	switch(pt)
	{
	case 'a' ... 'h':
		return PAWN;
	case 'K':
		return KING;
	case 'N':
		return KNIGHT;
	case 'Q':
		return QUEEN;
	case 'R':
		return ROOK;
	case 'B':
		return BISHOP;
	default:
		return -1;
	}
}

//Get the piece's score.
int get_piece_score(enum piece_type type)
{
	switch(type)
	{
	case PAWN:
		return 1;
	case KNIGHT:
	case BISHOP:
		return 3;
	case ROOK:
		return 5;
	case QUEEN:
		return 9;
	default:
		return -1;
	}
}

//Reads a side's move.
void read_side(char *buf, int *opp_score, int base_rank)
{
	int cur = 0;
	enum piece_type piece;
	if(strncmp("O-O", buf, 3) == 0) {
		board[5][base_rank] = ROOK;
		board[6][base_rank] = KING;
		return;
	}
	else if(strncmp("O-O-O", buf, 5) == 0) {
		board[3][base_rank] = ROOK;
		board[2][base_rank] = KING;
		return;
	}
	
	//First character is always the piece (In a non-castling situation)
	piece = get_piece_type(buf[cur]);
	
	
	if(piece != PAWN || buf[cur + 1] == 'x')
		cur++;
		
	//If the current symbol is only to resolve ambiguity (Nbd2 or Nbxd2), skip it
	if(isalpha(buf[cur + 1]) && buf[cur] != 'x')
		cur++;
		
	if(buf[cur] == 'x') { //Capture occurrs
		cur++;
		enum piece_type cap_piece = 
			board[get_file_num(buf[cur])][get_rank_num(buf[cur + 1])];
		*opp_score -= get_piece_score(cap_piece);
	}
	//Update board.
	board[get_file_num(buf[cur])][get_rank_num(buf[cur + 1])] = piece;
}

void read_line(char *buf)
{
	char *black_move = strchr(buf, ' ');
	//Read white, skip the whitespace, then read black
	read_side(buf, &score_black, 0);
	read_side(black_move + 1, &score_white, 7);
}


int main(void) 
{
	char input[BUFSIZE];
	do {
		fgets(input, BUFSIZE, stdin);
		read_line(input);
	} while(!feof(stdin));
	
	printf("%d-%d\n", score_white, score_black);
	return 0;
}
