uses
	SysUtils,Math;

var
	ans , N , A , B : string;
	c : char;
	i : longint;

function minus( x , y : string ) : string;
var
	a , b , c : array[ 1..1000 ] of longint;
	dla , dlb , dlc , i : longint;

begin
 dla := length( x );
 dlb := length( y );
 for i := 1 to dla + 1 do
  begin
   c[ i ] := 0;
   b[ i ] := 0;
   a[ i ] := 0;
  end;
 for i := 1 to dla do
  a[ i ] := ord( x[ i ] ) - 48;
 for i := 1 to dlb do
  b[ i ] := ord( y[ i ] ) - 48;
 for i := 1 to dla do
  c[ i ] := a[ i ] - b[ i ];
 for i := 1 to dla do
  if c[ i ] < 0 then 
   begin
    c[ i ] := c[ i ] + 10;
    dec( c[ i + 1 ] );
   end;
 dlc := 0;
 for i := dla + 1 downto 1 do
  if c[ i ] <> 0 then
   begin
    dlc := i;
    break;
   end;
 minus := '';
 for i := 1 to dlc do
  minus := minus + inttostr( c[ i ] );
end;

function sum( x , y : string ) : string;
var
	a , b , c : array[ 1..1000 ] of longint;
	dla , dlb , dlc , i : longint;

begin
 dla := length( x );
 dlb := length( y );
 for i := 1 to dla + dlb do
  begin
   c[ i ] := 0;
   b[ i ] := 0;
   a[ i ] := 0;
  end;
 for i := 1 to dla do
  a[ i ] := ord( x[ i ] ) - 48;
 for i := 1 to dlb do
  b[ i ] := ord( y[ i ] ) - 48;
 for i := 1 to dla + dlb do
  c[ i ] := a[ i ] + b[ i ];
 for i := 1 to dla + dlb do
  begin
   c[ i + 1 ] := c[ i + 1 ] + c[ i ] div 10;
   c[ i ] := c[ i ] mod 10;
  end;
 dlc := 0;
 for i := dla + dlb downto 1 do
  if ( c[ i ] <> 0 ) then
   begin
    dlc := i;
    break;
   end;
 sum := '';
 for i := 1 to dlc do
  sum := sum + inttostr( c[ i ] );
end;

begin
 assign( input , 'D.in' );
  reset( input );
 assign( output , 'D.out' );
  rewrite( output );
 c := '#';
 while c <> ' ' do
  begin
   read( c );
   if c <> ' ' then
    insert( c , N , 1 );
  end;
 c := '#';
 while c <> ' ' do
  begin
   read( c );
   if c <> ' ' then
    insert( c , A , 1 );
  end;
 c := '#';
 while not seekeoln do
  begin
   read( c );
   if c <> ' ' then
    insert( c , B , 1 );
  end;
 ans := '';
 ans := minus( N , A );
 ans := sum( ans , B );
 for i := length( ans ) downto 1 do
  write( ans[ i ] );
 writeln;
 close( output );
end.