unittest
{
	assert( [ "3", "3 4 6" ].parse.expand.solve == 10 );
	assert( [ "5", "7 46 11 20 11" ].parse.expand.solve == 90 );
	assert( [ "7", "994 518 941 851 647 2 581" ].parse.expand.solve == 4527 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.strip.to!( long );
	input.popFront;
	auto as = input.front.split.to!( long[] );
	
	return tuple( as );
}

auto solve( in long[] as )
{
	auto r = 0L;
	
	foreach( a; as )
	{
		r += a - 1;
	}
	
	return r;
}
