unittest
{
	assert( [ "3", "3", "2", "5" ].parse.expand.solve == 3 );
	assert( [ "15", "3", "1", "4", "1", "5", "9", "2", "6", "5", "3", "5", "8", "9", "7", "9" ].parse.expand.solve == 18 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
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.to!( long );
	auto as = new long[ n ];
	foreach( ref a; as )
	{
		input.popFront;
		a = input.front.to!( long );
	}
	return tuple( as );
}

auto solve( long[] as )
{
	auto ans = 0L;
	auto m = 0L;
	foreach( a; as )
	{
		if( m + 1 < a )
		{
			auto c = ( a - 1 ) / ( m + 1 );
			ans += c;
			a = 1;
		}
		m = max( m, a );
	}
	return ans;
}
