unittest
{
	assert( [ "3 3 2", "1 2", "5 4", "9 2" ].parse.expand.solve == 2 );
	assert( [ "9 4 1", "1 5", "2 4", "3 3", "4 2", "5 1", "6 2", "7 3", "8 4", "9 5" ].parse.expand.solve == 5 );
	assert( [ "3 0 1", "300000000 1000000000", "100000000 1000000000", "200000000 1000000000" ].parse.expand.solve == 3000000000 );
	
	assert( [ "9 2 2", "1 3", "2 4", "3 3", "4 2", "5 5", "6 2", "7 3", "8 4", "9 5" ].parse.expand.solve == 5 );		// 追加ケース
}



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 nda = input.front.split.to!( long[] );
	auto xhs = new long[ 2 ][ nda[ 0 ] ];
	foreach( ref xh; xhs )
	{
		input.popFront;
		xh = input.front.split.to!( long[] );
	}
	return tuple( nda[ 1 ], nda[ 2 ], xhs );
}

auto solve( long d, long a, long[ 2 ][] xhs )
{
	xhs.sort();
	
	auto ans = 0L;
	auto bs = new long[ xhs.length + 1 ];
	auto bt = 0L;
	for( auto li = 0L, ri = 1L; li < xhs.length; /* nop */ )
	{
		// 爆弾を使う座標を計算
		auto cx = xhs[ li ][ 0 ] + d;
		
		// 爆弾の範囲右端の一つ外を検索
		while( ri < xhs.length && xhs[ ri ][ 0 ] <= cx + d ) ri++;
		
		// 左端のモンスターを倒せる分だけ爆弾を使う
		auto b = ( ( xhs[ li ][ 1 ] - a * bt ) + ( a - 1 ) ) / a;
		bs[ li ] += b;
		bs[ ri ] -= b;
		bt += b;
		ans += b;
		
		// 次の範囲の左端を検索
		while( li < xhs.length && xhs[ li ][ 1 ] <= a * bt )
		{
			li++;
			bt += bs[ li ];
		}
	}
	return ans;
}
