#!/usr/bin/perl
($username) = @ARGV;
open (CORRECT,"recout.mlf") || die ("Unable to open recout.mlf for reading");
while () {
	if(/$find/)	{
		$total=$total+(substr($_,  index($_,"-") , 29) );
	}
}
close(CORRECT);

open (ANTI,"recout1.mlf") || die ("Unable to open recout1.mlf for reading");
while () {
	if(/$find/)	{
		$total1=$total1+(substr($_,  index($_,"-") , 29) );
	}
}

open (REZ,">finalresult.txt") || die ("Unable to open file for writing");
$diff= $total-$total1;
print (REZ "$diff");

close(ANTI);
close(REZ);