{$ifdef fpc} {$mode delphi} {$endif}
{$apptype console}
{$s+,i+,r+,q+,v+,d+,o-}
const
	filein = 'd.in';
	fileout = 'd.out';
	maxl = 110;
type
	bigint = array[0..maxl] of longint;

var
	n,a,b	: bigint; i : longint;

procedure dif(a,b: bigint; var c: bigint);
var i     	: longint; 
begin
	fillchar(c,sizeof(c),0);
//        for i:=1 to a[0] do write(a[i]); writeln;
//        for i:=1 to a[0] do write(b[i]); writeln;
	for i:=1 to a[0] do begin
	  c[i]:=c[i]+a[i]-b[i];
	  if c[i]<0 then begin
	    c[i]:=c[i]+10;
	    dec(c[i+1]);
	  end;
	end;
       	c[0]:=a[0]; 
       	while (c[c[0]]=0) and (c[0]>0) do dec(c[0]);
end;

procedure inputt(var a : bigint);
var ch : char; i,t : longint; 
begin
	fillchar(a,sizeof(a),0);
	read(ch);
	while not (ch in ['0'..'9']) do read(ch);
	while ch in ['0'..'9'] do begin
	  inc(a[0]); a[a[0]] := ord(ch)-ord('0');
	  read(ch);
	end;

	for i:=1 to a[0] div 2 do 
	 begin
	   t:=a[i]; a[i]:=a[a[0]- i +1]; a[a[0] - i + 1] := t; 
	 end;
end;


begin
	assign(input,filein); reset(input);
	assign(output,fileout); rewrite(output);
        inputt(n);        
        inputt(a);        
        inputt(b);
        dif(a,b,a);   
        dif(n,a,n);   
        for i:=n[0] downto 1 do write(n[i]); 
        if n[0]=0 then writeln(0) else writeln; 
	close(input); close(output);
end.

