George has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Alex who has also entered the university. Now they are moving into a dormitory. George and Alex want to live in the same room. The dormitory has n rooms in total. At the moment the i-th room has pi people living in it and the room can accommodate qi people in total (pi ≤ qi). Your task is to count how many rooms has free place for both George and Alex.

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of rooms. The i-th of the next n lines contains two integers pi and qi (0 ≤ pi ≤ qi ≤ 100) — the number of people who already live in the i-th room and the room's capacity.

Print a single integer — the number of rooms where George and Alex can move in.

var strArray = [];

var numberIterations = readline();
var countOfLivibleFloors = 0;

for (var i = 0; i < numberIterations; i++) {
    strArray.push(readline());
}

for (var i = 0; i < strArray.length; i++) {
  strFloor = strArray[i].split(" ");
  if ( (parseInt(strFloor[1]) - parseInt(strFloor[0])) >= 2) {
    countOfLivibleFloors++;
  }
}

print(countOfLivibleFloors)

var limit = readline();
var count = 0
while(limit > 0){
    var line = readline().split(" ")
    var numPeopleInRoom = parseInt(line[0]);
    var limitRoom = parseInt(line[1])
    if(numPeopleInRoom + 2 <= limitRoom) count++
    limit--
}

print(count)

var a = readline();

var rooms = [];
var freeRooms = 0;

function proc(){
  var res = true;
  while(res){
    res = readline();
    if (!res) break;
    rooms.push(res);
  }
}

proc();

for (var i = 0; i < rooms.length ; i++) {
  var s = rooms[i].split(' ');
  if((Number(s[1]) - Number(s[0])) >= 2 ) {
      freeRooms++;
  }
}

print(freeRooms);

var a = readline();

var rooms = [];
var freeRooms = 0;

function read () {
    return readline() ;
}

function proc(){
  var res = true;
  while(res){
    res = read();
    if (!res) break;
    rooms.push(res);
  }
}

proc();

for (var i = 0; i < rooms.length ; i++) {
  var s = rooms[i].split(' ');
  if((Number(s[1]) - Number(s[0])) >= 2 ) {
      freeRooms++;
  }
}

print(freeRooms);

readline();
var rooms = [];
var freeRooms = 0;
var res = true;
while(res){
  res = readline();
  if (!res) break;
  rooms.push(res);
}
for (var i = 0; i < rooms.length ; i++) {
  var s = rooms[i].split(' ');
  if((s[1] - s[0]) >= 2 ) {
      freeRooms++;
  }
}
print(freeRooms);

/* TEST CASE
input
3
1 1
2 2
3 3
output
0

input
3
1 10
0 10
10 10
output
2

 */
function main() {
	var n = parseInt(readline());
	var answer = 0;

	for (var i = 0; i < n; i++) {
		var s = readline().split(' ');
		if (parseInt(s[1]) - parseInt(s[0]) >= 2) {
			answer++;
		}
	}

	print(answer);
}

main();

const n = parseInt(readline())
var count = 0
for (var i = 0; i < n; i++){
  var line = readline()
  var lineArr = line.split(" ")
  var p = parseInt(lineArr[0])
  var q = parseInt(lineArr[1])
  if (q - p >= 2){
    count++;
  }
}
print(count)

var n = parseInt(readline()),
			count = 0;

		for(var i = 0; i < n; i++)	{
			var p = readline().split(/\s/gi),
				q = p[1], p = p[0];

			if(p <= q - 2)	count++;
		}

		print(count);

var n = parseInt(readline());

var room = 0;
for (var i = 0; i < n; i++) {
    var s = readline().split(' ');

    if (s[1] - s[0] >= 2) {
        room++;
    }
}

print(room);

var str = Number(readline()),
    res = 0;

for (var i = 0; i < str; i++) {
    var data = readline().split(' '),
        now = Number(data[0]),
        all = Number(data[1]);

        if (now + 2 <= all) res++;
}

print(res);

var entrada = readline();
var hab = 0;

for(var i = 0; i < entrada; i++){

	var num = readline();
	num = num.split(" ");
	var resta = num[1] - num[0];

	if( resta>=2){
		hab++;
	}
}

print(hab);

function UraAndRooms(arr)
{
    var result = 0;
    function minus(a)
    {
        return +a[1] - +a[0];
    }
    for (var i = 0; i <= arr.length - 1; i++)
    {
        var count = minus(arr[i].split(' '));
        if (count >= 2 ) result++;
    }
    return result;

}
{
	var arr = [];
    var num = readline();
	for (var i = 1; i <= +num; i++)
	{
		var input = readline();
		arr.push(input);
	}
	print(UraAndRooms(arr));

}

var r = readline();
var room = 0;
for(var i = 0; i < r; i++){
	var n = readline().split(" ");
	if(n[1] - n[0] >=2)
		room++;
}
print(room);

var num = readline();
var count = 0;
while(num--){

    var room = readline().split(' ');
    if(room[1] - room[0] >= 2){
        count++;
    }
}

print(count);

var n = parseInt(readline(), 10),
    inp = '',
    room = 0;

for(var i=1; i<=n; i++) {
    inp = readline().split(' ');

    if(inp[1]-inp[0] >= 2) room++;
}

print(room);

var n = readline()
var bol = 0
for (var i = 0; i < n; i++) {
    var rez = 0
    var line = readline()
    line = line.split(" ")
    rez = line[1] - line[0]
    if(rez >= 2){
        bol++
    }
}
print(bol)

var result = 0;
var total = readline();
for(var i = 0; i< total; i++){
  var item = readline().split(' ');
  if(parseInt(item[1]) - parseInt(item[0]) >= 2) result ++;
}
print(result);

(function () {
    var count = parseInt(readline());

    var result = 0;
    for (var i = 0; i < count; i++){
        var nums = readline().trim().split(' ').map(Number);
        if (nums[0] + 2 <= nums[1]){
            result++;
        }
    }

    print(result);

    return 0;
})();

var a, b = 0;
readline();

while (a = readline()) {
  a = a.split(' ');
  if (a[1] - a[0] > 1) b++;
}

print(b);

var n = parseInt(readline())
var c = 0;
for(var i = 0; i < n; ++i) {
	var line = readline().split(" ");
	p = parseInt(line[0]);
	q = parseInt(line[1]);

	if(q - p >= 2) {
		++ c;
	}
}
print(c);

var n = Number(readline());

var count = 0;
while (n > 0) {
    var s = readline().split(' ').map(function(each) {return Number(each);});
    if (s[1] - s[0] >= 2)
        ++count;
    --n;
}

print(count);

function main(){

    var n = readline();
    var count = 0;

    for(i=0;i<n;i++){
	var line = readline().split(' ');
	var p = line[0];
	var q = line[1];

	if(q-p>=2){
	    count+=1;
	}
    }

    print(count);
}

main();

no = readline();
var vector;
var t = 0;
for (var i = 0; i < no; i++) {
         vector = readline().split(' ');
         if( parseInt(vector[1]) - parseInt(vector[0]) >=2 )
             t++;
}
write(t);

var n = readline();
var quan = 0;

for (var i=0; i<n; i++) {
    var s = readline().split(' ');
    (Number(s[0])+2 <= s[1])?quan++:0;
}

print(quan);

// George has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Alex who has also entered the university. Now they are moving into a dormitory.

// George and Alex want to live in the same room. The dormitory has n rooms in total. At the moment the i-th room has pi people living in it and the room can accommodate qi people in total (pi ≤ qi). Your task is to count how many rooms has free place for both George and Alex.

// Input
// The first line contains a single integer n (1 ≤ n ≤ 100) — the number of rooms.

// The i-th of the next n lines contains two integers pi and qi (0 ≤ pi ≤ qi ≤ 100) — the number of people who already live in the i-th room and the room's capacity.

// Output
// Print a single integer — the number of rooms where George and Alex can move in.

var n = readline()
var c = 0

for (i = 0; i < n; i++) {
    var x = readline().split(' ')
    if (+x[1] - (+x[0] + 2) >= 0) {
        c++
    }
}

print(c)

var n = readline();
var rooms = [];
for (var i = 0;i < n; ++i){
  var temp = readline().split(" ");
  rooms.push(temp);
}
var result = rooms.filter((room) => {
  if(room[1] - room[0] >= 2) return true;
  return false;
}).length;

print(result);

var n = parseInt(readline());

var room = 0;

for (var i = 0; i < n; i++) {

    var numbers = readline().split(" ").map(function(x) { return parseInt(x); });

    room = numbers[1] - numbers[0] >= 2 ? room + 1 : room;
}

print(room);

var n = parseInt(readline());
var count = 0;
for (var i = 0; i < n; i ++){
    var string = readline().split(" ");
    var numberOfPeople = parseInt(string[0]);
    var maxNumberOfPeople = parseInt(string[1]);
    if ((maxNumberOfPeople - numberOfPeople) >= 2){
        count++;
    }
}
print(count);

var rooms = readline()
var count = 0
for(var i=1; i <= rooms; i++){
var line = readline(i).split(" ")
if ((line[1] - line[0]) >= 2){
    count ++
}
}
print(count)

var count = readline();var calc = 0;

for (var i = 0; i < count; i++)
{
var r = readline().split(' ');r =r[1] - r[0];
if(r>=2){calc+=1;}
}

print(calc);

(function () {
    var n = parseInt(readline()),
        i = 0,
        sum = 0,
        line;
    for (; i < n; i++) {
        line = readline().split(" ");
        if ((line[1] - line[0]) > 1) {
            sum++;
        }
    }
    print(sum);
})();

n = readline();
var count = 0;
while(n--){
	k = readline().split(" ")
	if(parseInt(k[0]) + 1 < parseInt(k[1]))
	{count++}
}
print(count)

var input = readline();
var cont = 0;
for(var i = 0; i < input; i++){
	var ocupantes = readline().split(" ");
	if(ocupantes[1] - ocupantes[0] >=2)
		cont++;
}
print(cont);

var numberRooms = readline();
var numberFreeRooms = 0;
for (var n=0; n < numberRooms; n++) {
    var roomInfo = readline().split(' ');
    var numberOccupiedPlace = roomInfo[0];
    var numberSeatsRoom = roomInfo[1];
    if (numberSeatsRoom-numberOccupiedPlace >= 2) {
        numberFreeRooms++;
    }
}
print(numberFreeRooms);

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw "ArrayIndexOutOfBoundsException ‚There is no more input";}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  var output = 0;
  for(var i = 0; i < N; i++){
    var tmp = nextIntArray();
    if(tmp[1] - tmp[0] >= 2){
      output++;
    }
  }
  myout(output);
}

let inputString = '';
let currentLine = 0;

const runMain = () => {
  inputString = inputString.trim().split('\n').map(string => string.trim());
  main();
  process.exit();
}
const readLine = () => inputString[currentLine++];

process.stdin.on('data', inputStdin => inputString += inputStdin);
process.stdin.on('end', runMain);
process.on('SIGINT', runMain);

function main() {
  let n = Number(readLine());
  let sum = 0;
  while (n--) {
    const [p, q] = readLine().split(' ').map(_a => Number(_a));
    if (q - p > 1) {
      sum++;
    }
  }
  console.log(sum);
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

let first = true;
const rooms = [];
rl.on('line', line => {
    if (first) {
        first = false;
        return;
    }

    const input = line.split(' ');
    rooms.push(input);
});

rl.on('close', () => console.log(solution(rooms)));

function solution(rooms) {
    let numberOfAvailableRooms = 0;
    for (let i = 0; i < rooms.length; i++) {
        let room = rooms[i];
        let freeSpaceInRoom = room[1] - room[0];
        if (freeSpaceInRoom > 1) {
            numberOfAvailableRooms++;
        }
    }

    return numberOfAvailableRooms;
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let counter = 0;
let ans = 0;

rl.on('line', (d) => {
  if (counter === 0) {
    counter++;
    return;
  }

  let [p, q] = d.split(' ').map(Number);

  if (p + 2 <= q) {
    ans++;
  }
  counter++;
});

rl.on('close', () => {
  console.log(ans);
});

const readLine = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  let answer = 0;
  input.forEach((line, i) => {
    if (i === 0) return;
    const nums = line.split(' ').map(x => parseInt(x));

    if (nums[1] - nums[0] >= 2) answer += 1;
  });

  console.log(answer);
});

'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

const readLine=()=> inputString[currentLine++];
/* ================================================
           Main Solution Starts Here
===================================================*/

const main=()=>{
	let t=+readLine()
	let rooms=0

	while(t--){
		let [a,b] = readLine().split(" ").map(n=>+n)
		if(b-a>=2)
			rooms++
	}

	console.log(rooms)
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function readAsInt(){
  return parseInt(readline());
}

function readAsIntList(){
  return readline().split(' ').filter(i => i).map(i => parseInt(i));
}

// Make a Snippet for the code above this and then write your logic in main();

function main() {
  let n = readAsInt();
  let total = 0;
  for(let i = 1;i <= n; i++){
    let [p, q] = readAsIntList();
    total += (q - p) >= 2 ? 1 : 0;
  }
  console.log(total);
}

process.stdin.resume();
process.stdin.setEncoding("utf-8");

let currentLine = 0;
let inputString = "";

process.stdin.on("data", (raw_data) => {
  inputString += raw_data;
});

process.stdin.on("end", (_) => {
  inputString = inputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function readLine() {
  return inputString[currentLine++];
}

/******** Main function*************/

function main() {
  var n = +readLine();

  var arr = [];
  for (var i = 0; i < n; i++) {
    var s = readLine().split(" ").map(Number);
    arr.push(...s);
  }

  var item1 = 0;
  var item2 = 1;
  var count = 0;
  while (n > 0) {
    if (arr[item2] - arr[item1] >= 2) {
      count++;
    }
    item1 += 2;
    item2 += 2;
    n--;
  }
  console.log(count);
}

let fs = require("fs");

let txt = fs.readFileSync(0, "utf-8").split("\r\n").filter(data => {
    return data.length > 0;
});

for (let index = 0; index < txt.length; index ++) {
    if(!isNaN(txt[index]*1)){
        let tab=0;
        for (let i = index+1; i <=index+txt[index]*1; i++) {
            let r=txt[i].split(" ");
            if(r[1]-r[0]>=2){
                ++tab;
            }
        }
        console.log(tab);

    }

}

// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

function main(input) {
    let output = nameLookUp(input);
    process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(str) {
    let inputs = str.trim().split('\n');
    let rooms = +inputs[0];
    let roomsLeft = 0;
    for (let i = 1; i <= rooms; i++) {
        let [p, q] = inputs[i].trim().split(' ');
        if ((q - p) >= 2) {
            roomsLeft++;
        }
    }
    return roomsLeft.toString();
}

const readLine = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout,
});

const input = [];
readLine.on('line', line => input.push(line));
const rooms = () => {
    +input.shift();
    let count = 0;
    for (const x of input) {
        let n = x.split(' ').map(x => +x);
        for (let i = 1; i > 0; i--) {
            if (n[i] - n[i-1] >= 2) {
                count++;
            }
        }
    }
    console.log(count);
};
readLine.on('close', rooms);

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.replace(/\s*$/, '')
        .split('\n')
        .map(str => str.replace(/\s*$/, ''));

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
    let n = parseInt(readLine());
    let ans = 0;
    for (var i = 0; i < n; i++) {
        const arr = readLine()
            .split(' ')
            .map(value => parseInt(value));

        if (arr[1] - arr[0] >= 2) {
            ans++;
        }
    }
    console.log(ans);
}

var n = Number(readline());
var k =0;
for (var i = 0; i < n; ++i){
    var str = readline();
    var a = Number(str.split(" ")[0]);
    var b = Number(str.split(" ")[1]);
    if ((b-a) >=2 ){
        ++k;
        }
}
print(k);

var n = +readline(), input, p, q, counter = 0;

for(i = 0; i < n; i++){
	input = readline().split(" ");
	p = +input[0];
	q = +input[1];

	if( (q-p) >= 2 ){
		counter++;
	}
}
write(counter);

var n = readline()

var sum = 0

for(var i = 0; i < n ;i++) {
    var line = readline().split(' ')
    var a = parseInt(line[0])
    var b = parseInt(line[1])

    if(b - a - 2 >= 0) {
        sum++
    }
}

print(sum)

function main(){
    var n = readline();
    var res = 0;
    for(var i = 0; i < n; ++i){
        var c = readline().split(' ');;
        if(+c[1] - +c[0] >= 2) ++res;
    }
    print(res);
}

main();

var r=+readline();
var j=0;
for(var i=0;i<r;i++){
    var p=readline().split(' ');
    var q=+p[1];
    var d=+p[0];
    if((q-d) >= 2){
        j++;
    }
}
print(j);

var r = +readline(), p, q, d, count = 0;
for(i=0; i < r; i++){
    p = readline().split(" ");
    q = +p[1];
    d = +p[0];
    if((q-d) >= 2){
        count++;
    }
}
write(count);

var n = readline() - 0;

var t = 0;
for (var i = 0; i < n; i++) {
    var IN = readNums();
    if (IN[1] - IN[0] >= 2) {
        t++;
    }
}
print(t);

function readNums() {
    return readline().split(' ').map(v => v - 0);
}

m=readline()
sum=0
for(i=0;i<m;i++)
{
   r=readline().split(' ')
   if(parseInt(r[0])<=parseInt(r[1])-2 )
       sum=sum+1

}
print(sum)

print(answer());
function answer(){
    var numRooms = readline();
    var room;
    var output = 0;
    for(var i = 0; i < numRooms; i++){
        room = readline().split(' ');
        if(room[1]-room[0] >= 2){
            output++;
        }
    }
    return output;
}

var n = readline();
var count = 0;

for (var i = 0; i < n; i++) {
    var str = readline().split(' ');
    if ((str[1] - str[0]) >= 2) count++;
}

print(count);

var n = parseInt(readline()),
	counter = 0

while (n > 0) {
	var ns = readline().split(' ').map(function(i) {
		return parseInt(i)
	})
	if (ns[1] - ns[0] > 1)
		counter ++
	n --
}

print(counter)

var numberOfRoom = +readline();
var answer = 0;
for(var i = 1; i <= numberOfRoom; i ++) {
    var line = readline().split(' ');
    if(+line[0]+2 <= +line[1]) {
        answer++;
    }
}

print(answer);

var no_rooms = parseInt(readline());
var available = 0;
for(var i=0; i<no_rooms; i++){
    var acc = readline().split(" ").map(x=>parseInt(x));
    var already  = acc[0];
    var capacity = acc[1];
    if(capacity-already >=2){
        available++;
    }
}
print(available);

;(function () {
	print(function (n) {
		var t = 0;
		while (n--) t += Number(readline().split(' ').map(Number).reduce(function (a, b) { return Math.abs(a - b); }) > 1);
		return t;
	}(+readline()));
}.call(this));

var lines = +readline();
var counter = 0;

for(var i = 0; i < lines; i ++){
	var pq = readline().split(' ').map(x => +x);
	var p = pq[0];
	var q = pq[1];
	if(q - p >= 2){
		// Possible to move in
		counter ++;
	}
}

print(counter);

var n = parseInt(readline());

var ans = 0;
for(var i=0;i<n;i++){
    var p,q;
    var temp = readline();
    p = temp.split(" ")[0];
    q = temp.split(" ")[1];
    if(q-p>=2){
        ans++;
    }
}

print(ans);

var n = parseInt(readline());
var count = 0;
for(var i = 0; i<n; i++) {
    var s = readline().split(" ");
    if (s[1] - s[0] >= 2) {
        count++;
    }
}
print(count);

(function () {
    var n = parseInt(readline()),
        i = 0,
        sum = 0,
        line;
    for (; i < n; i++) {
        line = readline().split(" ");
        if ((line[1] - line[0]) > 1) {
            sum++;
        }
    }
    print(sum);
})();

const main = () => {
  const n = readline();
  const arr = [];
  var numRooms = 0;

  for (i of Array(Number(n))
    .fill()
    .map((a, b) => parseInt(b))) {
    arr.push(
      readline()
        .split(" ")
        .map((x) => parseInt(x))
    );
  }

  for (i of arr) {
    if (i[0] + 2 <= i[1]){
      numRooms++;
    }
  }
  print(numRooms);
};
main();

var line = readline()
  var result = 0

  while (line--) {
    var currentRoom = readline().split(' ')
    var currentOcupacy = parseInt(currentRoom[0], 10)
    var maxOcupacy = parseInt(currentRoom[1], 10)
    if (currentOcupacy + 2 <= maxOcupacy) result++
  }

  print(result)

function ProblemSolver() {

    this.solveCase = function() {
        var res , i , j , a ;
        res = 0;
        for( i = 0 ; i < this.n ; i++ ) {
            a = Math.abs( this.arr[ i ] - this.brr[ i ] ) ;
            if( a >= 2 ) {
                res++ ;
            }
        }
        print( res );
    };

    this.getInput = function( irObj ) {
        var hasMoreInput , i;
        hasMoreInput = true;
        try {
            this.n = irObj.nextInt();
            for( i = 0 ; i < this.n ; i++ ) {
                this.arr[ i ] = irObj.nextInt();
                this.brr[ i ] = irObj.nextInt();
            }
        }
        catch( ex ) {
            hasMoreInput = false;
        }
        return hasMoreInput;
    };

    this.clearArraysPerCase = function() {
        var i;
        this.arr = new Array();
        this.brr = new Array();
        this.adj_list = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.arr.push( 0 );
            this.brr.push( 0 );
            this.adj_list.push( new Array() );
        }
    };

    this.clearPerCase = function() {
        this.cn = 0;
        this.cc++;
        //this.clearArraysPerCase() ;
    };

    this.HAS_TEST_CASES = false;
    this.INPUT_FILE_NAME = "test.in";
    this.OUTPUT_FILE_NAME = "out.txt";
    this.DO_OUTPUT_TO_FILE = false;

    this.declareAndFillArrays = function() {
        var i , j;
        this.srr = new Array();
        this.vis = new Array();
        this.arr = new Array();
        this.brr = new Array();
        this.memo = new Array();
        this.done = new Array();
        this.adj_list = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.srr.push( "" );
            this.vis.push( 0 );
            this.arr.push( 0 );
            this.brr.push( 0 );
            this.adj_list.push( new Array() );
        }
        for( i = 0 ; i < this.lim2 ; i++ ) {
            this.memo.push( new Array() );
            this.done.push( new Array() );
            for( j = 0 ; j < this.lim2 ; j++ ) {
                this.memo[ i ].push( -1 );
                this.done[ i ].push( 0 );
            }
        }
    };

    this.init = function() {
        this.lim1 = 100010;
        this.lim2 = 110;
        this.cc = 1;
        this.ind = 1;
        this.n = 0;
        this.cn = 0;
        this.declareAndFillArrays();
    };

    this.memsetArray1D = function( arrParam , val ) {
        var i;
        if( arrParam == null ) {
            throw new Error( "No array supplied in the parameter!" );
        }
        if( val == null ) {
            throw new Error( "No value for memset has been supplied in the parameter!" );
        }
        arrParam = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            arrParam.push( val );
        }
        return arrParam;
    };

    this.getStringLength = function( stringData ) {
        var len , lengthType;
        len = stringData.length;
        lengthType = typeof len;
        if( lengthType == "function" ) {
            len = stringData.length();
        }
        else {
            len = stringData.length;
        }
        return len;
    };

    this.init();
}

function InputReader() {
    this.allLines = new Array();
    this.currrentLineNumber = 0;
    this.currrentCharacterIndex = 0;

    this.readAllLines = function() {
        var singleLine;
        while( true ) {
            try {
                singleLine = readline();
                if( singleLine == null ) {
                    break;
                }
            }
            catch( ex ) {
                break;
            }
            this.allLines.push( singleLine );
        }
    };

    this.readAllLinesFromRhinoStdin = function() {
        importPackage( java.io );
        importPackage( java.lang );
        var singleLine , reader;
        reader = new BufferedReader( new InputStreamReader( System[ "in" ] ) );
        this.allLines = [];
        while( true ) {
            singleLine = reader.readLine();
            if( singleLine != null ) {
                this.allLines.push( singleLine );
            }
            else {
                break;
            }
        }
    };

    this.readAllLinesFromNodeStdin = function() {
        var fsObj , size , rawData;
        process.stdin.setEncoding( 'ascii' );
        fsObj = require( 'fs' );
        size = fsObj.fstatSync( process.stdin.fd ).size;
        rawData = fsObj.readSync( process.stdin.fd , size )[ 0 ];
        this.parseRawData( rawData );
    };

    this.parseRawData = function( data ) {
        var len , i , currentString;
        len = data.length;
        currentString = "";
        for( i = 0 ; i < len ; i++ ) {
            if( data[ i ] == '\r' ) {
            }
            else if( data[ i ] == '\n' ) {
                this.allLines.push( currentString );
                currentString = "";
            }
            else {
                currentString += data[ i ];
            }
        }
        if( currentString != "" ) {
            this.allLines.push( currentString );
        }
    };

    this.readAllLinesFromFile = function( inputFileName ) {
        var currentDirectory , fsObj , inputFilePath , rawData;
        fsObj = require( 'fs' );
        currentDirectory = __dirname;
        inputFilePath = currentDirectory + "\\" + inputFileName;
        rawData = fsObj.readFileSync( inputFilePath , "utf8" );
        this.parseRawData( rawData );
    };

    this.next = function( flag ) {
        var len , i , startIdx , res , endIdx , lengthType;
        len = this.allLines[ this.currrentLineNumber ].length;
        lengthType = typeof len;
        if( lengthType == "function" ) {
            len = this.allLines[ this.currrentLineNumber ].length();
        }
        if( flag == 0 ) {
            res = "";
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                res += String.fromCharCode( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) );
            }
            this.currrentLineNumber++;
            this.currrentCharacterIndex = 0;
            return res;
        }
        while( true ) {
            if( this.currrentLineNumber >= this.allLines.length ) {
                throw new Error( "No more tokens available!" );
            }
            startIdx = -1;
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) != ' '.charCodeAt( 0 ) && this.allLines[ this.currrentLineNumber ].charCodeAt( i ) != '\t'.charCodeAt( 0 ) ) {
                    startIdx = i;
                    break;
                }
            }
            if( startIdx == -1 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
                continue;
            }
            res = "";
            endIdx = -1;
            for( i = startIdx ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) == ' '.charCodeAt( 0 ) || this.allLines[ this.currrentLineNumber ].charCodeAt( i ) == '\t'.charCodeAt( 0 ) ) {
                    endIdx = i;
                    break;
                }
                res += String.fromCharCode( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) );
            }
            if( endIdx == -1 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
            }
            else {
                this.currrentCharacterIndex = endIdx;
            }
            return res;
        }
    };

    this.nextInt = function() {
        return parseInt( this.next( 1 ) );
    };

    this.nextDouble = function() {
        return parseFloat( this.next( 1 ) );
    };

    this.nextString = function() {
        return this.next( 1 );
    };

    this.nextLine = function() {
        this.next( 0 );
    };
}

function FileOutputHandler() {
    this.resultantStringArray = new Array();

    this.addNewLine = function( newString ) {
        this.resultantStringArray.push( newString );
    };

    this.clearPercase = function() {
        this.resultantStringArray = new Array();
    };

    this.flushOutOutputToFile = function( outputFileName ) {
        var i , sz , res , currentDirectory , fsObj , outputFilePath;
        res = "";
        sz = this.resultantStringArray.length;
        for( i = 0 ; i < sz ; i++ ) {
            if( i != 0 ) {
                res += "\n";
            }
            res += this.resultantStringArray[ i ];
        }
        fsObj = require( 'fs' );
        currentDirectory = __dirname;
        outputFilePath = currentDirectory + "\\" + outputFileName;
        if( currentDirectory.charAt( 1 ) != ":" ) {
            //not local machine/windows
            outputFilePath = outputFileName;
        }
        fsObj.writeFileSync( outputFilePath , res );
        this.clearPercase();
    };
}

function CodeExecutioner() {
    this.irObj = new InputReader();
    this.psObj = new ProblemSolver();
    this.fohObj = new FileOutputHandler();

    this.runCode = function() {
        var testCases , i , hasMoreTestCases , isLocalMachine , localContext;
        isLocalMachine = false;
        try {
            if( __dirname != null && __dirname.charAt( 1 ) == ':' ) {
                //only on windows
                isLocalMachine = true;
            }
        }
        catch( ex ) {
            isLocalMachine = false;
        }
        if( isLocalMachine == true ) {
            //local machine runs on node and relies on file i/o
            print = console.log;
            if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
                localContext = this.fohObj;
                print = function() {
                    localContext.addNewLine.apply( localContext , arguments );
                }
            }
            this.irObj.readAllLinesFromFile( this.psObj.INPUT_FILE_NAME );
        }
        else {
            //server machine
            try {
                var rlObj = readline;
                //server runs on javasctipt v8 distribution and has readline method on global context
                this.irObj.readAllLines();
            }
            catch( ex ) {
                try {
                    var pObj = process;
                    //server runs on node
                    print = console.log;
                    this.irObj.readAllLinesFromNodeStdin();
                }
                catch( ex ) {
                    try {
                        var ipObj = importPackage;
                        //server runs on rhino
                        this.irObj.readAllLinesFromRhinoStdin();
                    }
                    catch( ex ) {
                        throw new Error( "Unknown javasctipt distribution!" );
                    }
                }
            }
        }
        if( this.psObj.HAS_TEST_CASES == true ) {
            testCases = this.irObj.nextInt();
            for( i = 0 ; i < testCases ; i++ ) {
                this.psObj.clearPerCase();
                this.psObj.getInput( this.irObj );
                this.psObj.solveCase();
            }
        }
        else {
            while( true ) {
                this.psObj.clearPerCase();
                hasMoreTestCases = this.psObj.getInput( this.irObj );
                if( hasMoreTestCases == false ) {
                    break;
                }
                this.psObj.solveCase();
            }
        }
        if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
            //only works for local machine(tested)
            this.fohObj.flushOutOutputToFile( this.psObj.OUTPUT_FILE_NAME );
        }
    };

    this.runCode();
}

new CodeExecutioner();

var n = readline();
var s = [];
for (var i = 0; i < n; i++)
    s.push(readline().split(' '));
var count = 0;
for (var i = 0; i < n; i++)
    if ((s[i][1] - s[i][0]) >= 2)
        count++;
print(count);

var n = parseInt(readline());
var s = [];
for (var i = 0; i < n; i++)
    s.push(readline().split(' '));
var count = 0;
for (var i = 0; i < n; i++)
    if ((parseInt(s[i][1]) - parseInt(s[i][0])) >= 2)
        count++;
print(count);

var n = parseInt(readline());
var freeroom = 0;

for(var i = 0; i < n; i++)
{
	var pq = readline().split(' ');
	if((parseInt(pq[0]) + 2) <= parseInt(pq[1]))
		freeroom++;
}

print(freeroom);

var n = parseInt(readline());
var freeroom = 0;

for(var i = 0; i < n; i++)
{
	var pq = readline().split(' ');
	if((parseInt(pq[1]) - parseInt(pq[0])) >= 2)
		freeroom++;
}

print(freeroom);

'use strict';
let n = parseInt(readline()),
    answer = 0;

for (let i = 0; i < n; i++) {
    const array = readline().split(' ').map(function(value) {
        return parseInt(value);
    });

     if (array[1] - array[0] >= 2) {
        answer++;
     }
}

write(answer);

var n =readline();
var x = 0;
var str1 = "";
var room = [];
for (i=1;i<=n;i++) room.push(readline());
for(i=0;i<room.length;i++){
	str1 = room[i];
	var str = str1.split(" ");
	if ((str[1]-str[0])>=2) x++;
}
print (x);

var n = parseInt(readline());
var ar = [];
var res = 0;

for (var i = 0; i < n; i++) {
	ar[i] = readline().split(' ').map(function(i) {
		return parseInt(i);
	});

	if (ar[i][0] + 2 <= ar[i][1]) {
		res++;
	}
}

print(res);

var linenum = parseInt(readline());
var i, nums, count = 0;
for(i=0;i<linenum;i++){
    nums = readline().split(' ').map(function(numStr){
        return parseInt(numStr);
    });
    if(nums[1] - nums[0] >= 2){
        count ++;
    }
}

print(count);

var n = readline();
var res =0;

	for (var i=0; i<n; i++){
		var str = readline().split(" ");
		if (str[1]-str[0]>=2)
		{
			res++;
		}
	}
	print(res);

var n  = readline();
var str = readline().split(" ");// 3;
//var b = +str[1];
var room = 0;
	for (var i=0; i<+n; i++){

			if(+str[1]>=+str[0]+2)
			room++;
	}
print(room);

var a = readline();

var rooms = [];
var freeRooms = 0;

// for (let i = 0; i < a ; i++) {
//  var value = readline();
//   var s = value.split(' ');
//   if((Number(s[1]) - Number(s[0])) >= 2 ) {
//       freeRooms++;
//   }

//}

print(freeRooms);

const a = readline();
const b = [];
for (var i=0;i<a;i++){
  b.push(readline());
}
print(0);

var a = readline();

var rooms = [];
var freeRooms = 0;

function read () {
    var stroka = readline();
    return stroka === undefined || false ;
}

function proc(){
    while(read()){

    }
}

// for (let i = 0; i < a ; i++) {
//  var value = readline();
//   var s = value.split(' ');
//   if((Number(s[1]) - Number(s[0])) >= 2 ) {
//       freeRooms++;
//   }

//}

print(freeRooms);

const n = parseInt(readline())
var count = 0
for (var i = 0; i < n; i++){
  const lineArr = readline().split(' ')
  const p = parseInt(lineArr[0])
  const q = parseInt(lineArr[1])
  if (q - p >= 2)
    count++;
}
print(count)

const n = readline()
var count = 0
for (var i = 0; i < n; i++){
  const lineArr = readline().split(' ')
  const p = lineArr[0];
  const q = lineArr[1];
  if (q - p >= 2){
    count++;
  }
}
print(count)

const n = parseInt(readline())
var count = 0
for (var i = 0; i < n; i++){
  var line = readline()
  print(line)
  var lineArr = line.split(" ")
  const p = parseInt(lineArr[0])
  const q = parseInt(lineArr[1])
  if (q - p >= 2){
    count++;
  }
}
print(count)

const n = parseInt(readline())
var count = 0
for (var i = 0; i < n; i++){
  var lineArr = readline().split(' ')
  const p = parseInt(lineArr[0])
  const q = parseInt(lineArr[1])
  if (q - p >= 2)
    count++;
}
print(count)

const n = parseInt(readline())
var count = 0
for (var i = 0; i < n; i++){
  var line = readline()
  var lineArr = line.split(" ")
  const p = parseInt(lineArr[0])
  const q = parseInt(lineArr[1])
  if (q - p >= 2){
    count++;
  }
}
print(count)

const n = parseInt(readline())
var count = 0
for (var i = 0; i < n; i++){
  var line = readline()
  var lineArr = line.split(" ")
  print(lineArr[0])
  print(lineArr[1])
  const p = parseInt(lineArr[0])
  const q = parseInt(lineArr[1])
  if (q - p >= 2){
    count++;
  }
}
print(count)

const n = parseInt(readline())
var count = 0
for (var i = 0; i < n; i++){
  var line;
  while (line === undefined) {
    line = readline()
  }
  const lineArr = line.split(' ')
  const p = parseInt(lineArr[0])
  const q = parseInt(lineArr[1])
  if (q - p >= 2)
    count++;
}
print(count)

var n = parseInt(readline()),
			count = 0;

		for(var i = 0; i < n; i++)	{
			var p = readline().split(/\s/gi),
				q = p[1], p = p[0];

			if(p < q - 2)	count++;
		}

		print(count);

var n = parseInt(readline()),
			count = 0;

		for(var i = 0; i < n; i++)	{
			var p = readline().split(/\s/gi),
				q = p[1], p = p[0];

			if(p < q)	count++;
		}

		print(count);

var rooms = readline()
var count = 0
for(var i=1; i < rooms; i++){
var line = readline(i).split(" ")
if ((line[1] - line[0]) >= 2){
    count ++
}
}

print(count)

var count = readline();var calc = 0;
for (var i = 0; i < count.length; i++)
{
r = readline(); r = (r[1] - r[0]);if(r>=2){calc+=1;}

}
print(calc);

var count = readline();var calc = 0;

for (var i = 0; i < count.length; i++)
{
var r = readline().split(' ');
r = parseInt(r[1]) -  parseInt(r[0]);
if(r>=2){calc+=1;}

}
print(calc);

var count = readline();var calc = 0;
for (var i = 0; i < count.length; i++)
{
r = readline().split(' ');
r = parseInt(r[1]) -  parseInt(r[0]);
if(r>=2){calc+=1;}

}
print(calc);

var count = readline();var calc = 0;
for (var i = 0; i < count.length; i++)
{
r = readline().split(' ');
r = parseInt(r[1] - r[0]);
if(r>=2){calc+=1;}

}
print(calc);

var count = readline();var calc = 0;
for (var i = 0; i < count.length; i++)
{
r = readline().split(' ');
r = (r[1] - r[0]);
if(r>=2){calc+=1;}

}
print(calc);

process.stdin.resume();
process.stdin.setEncoding("utf-8");

let currentLine = 0;
let inputString = "";

process.stdin.on("data", (raw_data) => {
  inputString += raw_data;
});

process.stdin.on("end", (_) => {
  inputString = inputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function readLine() {
  return inputString[currentLine++];
}

/******** Main function*************/

function main() {
  var n = +readLine();

  var arr = [];
  for (var i = 0; i < n; i++) {
    var s = readLine().split(" ").map(Number);
    arr.push(...s);
  }

  var item1 = 0;
  var item2 = 1;
  var count = 0;
  while (n > 0) {
    if (arr[item2] - arr[item1]) {
      count++;
    }
    item1 += 2;
    item2 += 2;
    n--;
  }
  console.log(count);
}

var r= +readline();
var counter=0;
for(var i=0; i<r; i++){
    var p= +readline().split(), q=p[1], d=p[0];
    if(p <= q-2){
        counter++;
    }
}
print(counter);

var r= +readline();
var j=0;
for(var i=0; i<r; i++){
    var p= +readline();
    if(p[i+1]-p[i] >= 2){
        j++;
    }
}
print(j);

var r= +readline();
var j=0;
for(var i=0; i<r; i++){
    var p= +readline();
    if((p[i+1]-p[i]) >= 2){
        j++;
    }
}
print(j);

var r= +readline();
var counter=0;
for(var i=0; i<r; i++){
    var p= +readline().split(' '), q=p[1], d=p[0];
    if(p <= q-7){
        counter++;
    }
}
print(counter);

var r= +readline();
var counter=0;
for(var i=0; i<r; i++){
    var p= +readline().split(' '), q=p[1], d=p[0];
    if(p <= q-2){
        counter++;
    }
}
print(counter);

var r= +readline();
var j=0;
for(var i=0; i<r.length; i++){
    var p= +readline();
    if(p[i+1]-p[i] >= 2){
        j++;
    }
}
print(j);

var r=+readline();
var j=0;
for(var i=0;i<r;i++){
    var p=readline();
    if(p[i+1]-p[i] >= 2){
        j++;
    }
}
print(j);

var r = +readline();
var counter = 0;
for(i=0; i < r; i++){
    var p= +readline().split(" "), q=+p[1], d=+p[0];
    if((q-d) >= 2){
        counter++;
    }
}
print(counter);

var r=+readline();
var j=0;
for(var i=0;i<r;i++){
    var p=readline();
    if((p[i+1]-p[i]) >= 2){
        j++;
    }
}
print(j);

var r=+readline();
var j=0;
for(var i=0;i<r;i++){
    var p=+readline().split(' ');
    var q=+p[1];
    var d=+p[0];
    if((q-d) >= 2){
        j++;
    }
}
print(j);

var r= +readline();
var j=0;
for(var i=0; i<r; i++){
    var p= +readline();
    if(p[i]-p[i+1] >= 2){
        j++;
    }
}
print(j);

var r= +readline();
var counter=0;
for(var i=0; i<r; i++){
    var p= +readline().split(' '), q=p[1], d=p[0];
    if((q-d) >= 2){
        counter++;
    }
}
print(counter);

var r= +readline();
var p= +readline();
var j=0;
for(var i=0; i<r; i++){
    if(p[i+1]-p[i] >= 2){
        j++;
    }
}
print(j);

var r = +readline(), p, q, d, counter = 0;
for(i=0; i < r; i++){
    p = +readline().split(" ");
    q = +p[1];
    d = +p[0];
    if((q-d) >= 2){
        counter++;
    }
}
write(counter);

var r= +readline();
var p= +readline();
var j=0;
for(var i=0; i<r; i++){
    if((p[i+1]-p[i]) >= 2){
        j++
    }
}
print(j);

var r= +readline();
var counter=0;
for(var i=0; i<r; i++){
    var p= +readline().split(" "), q=+p[1], d=+p[0];
    if((q-d) >= 2){
        counter++;
    }
}
print(counter);

var r = +readline(), p, q, d, count = 0;
for(i=0; i < r; i++){
    p = +readline().split(" ");
    q = +p[1];
    d = +p[0];
    if((q-d) >= 2){
        count++;
    }
}
write(count);

var r= +readline();
var j=0;
for(var i=0; i<r; i++){
    var p= +readline();
    if((p[i+1]-p[i]) >= 2){
        j++
    }
}
print(j);

m=readline()
sum=0
for(i=0;i<m;i++)
{
   r=readline().split(' ')
   if(parseInt(r[0])<parseInt(r[1])-2 )
       sum=sum+1

}
print(sum)

var n = readline();
var s = [];
for (var i = 0; i < n; i++)
    s.push(readline().split());
var count = 0;

for (var i = 0; i < n; i++)
    if ((s[i][1] - s[i][0]) >= 2)
        count++;
print(count);

var n = readline();
var s = [];
for (var i = 0; i < n; i++)
    s.push(readline().split());
var count = 0;
for (var i = 0; i < n; i++)
    if ((s[i][1] - s[i][0]) >= 2)
        count++;
print(count);

var n = parseInt(readline());
var s = [];
for (var i = 0; i < n; i++)
    s.push(readline().split());
var count = 0;
for (var i = 0; i < n; i++)
    if ((parseInt(s[i][1]) - parseInt(s[i][0])) >= 2)
        count++;
print(count);

var n = parseInt(readline());
var freeroom = 0;

for(var i = 0; i < n; i++)
{
	var pq = readline().split(' ');
	if((parseInt(pq[0]) + 2) >= parseInt(pq[1]))
		freeroom++;
}

print(freeroom);

var n = parseInt(readline());
var freeroom = 0;

for(var i = 0; i < n; i++)
{
	var pq = readline();
	if((parseInt(pq[0]) + 2) >= parseInt(pq[1]))
		freeroom++;
}

print(freeroom);

var n = parseInt(readline());
var freeroom = 0;

for(var i = 0; i < n; i++)
{
	var pq = readline().split(' ');
	if((parseInt(pq[1]) - parseInt(pq[1])) >= 2)
		freeroom++;
}

print(freeroom);

var str1 = readline().split(" ");
var str2 = readline().split(" ");
print (str2);

var n =readline();
var room = [];
var str1 = " ";
for (i=1;i<=n;i++) room.push(readline());
print (room);

var str1 = readline().split(" ");
var str2 = readline();
print (str2);

var n  = readline();
var str = readline().split(" ");// 3;
//var b = +str[1];
var room = 0;
	for (var i=0; i<+n; i++){

			if(+str[1]-2>=+str[0])
			room++;
	}
print(room);


Everybody knows that the capital of Berland is connected to Bercouver (the Olympic capital) by a direct road. To improve the road's traffic capacity, there was placed just one traffic sign, limiting the maximum speed. Traffic signs in Berland are a bit peculiar, because they limit the speed only at that point on the road where they are placed. Right after passing the sign it is allowed to drive at any speed.It is known that the car of an average Berland citizen has the acceleration (deceleration) speed of a km/h2, and has maximum speed of v km/h. The road has the length of l km, and the speed sign, limiting the speed to w km/h, is placed d km (1 ≤ d < l) away from the capital of Berland. The car has a zero speed at the beginning of the journey. Find the minimum time that an average Berland citizen will need to get from the capital to Bercouver, if he drives at the optimal speed.The car can enter Bercouver at any speed.

The first line of the input file contains two integer numbers a and v (1 ≤ a, v ≤ 10000). The second line contains three integer numbers l, d and w (2 ≤ l ≤ 10000; 1 ≤ d < l; 1 ≤ w ≤ 10000).

Print the answer with at least five digits after the decimal point.

line = readline().split(' ');
a = parseInt( line[0] );
v = parseInt( line[1] );
line = readline().split(' ');
l = parseInt( line[0] );
d = parseInt( line[1] );
w = parseInt( line[2] );

function dist(v, t){
	return v*t + a*t*t/2;
}
function travel(distance, speed){
	var tmax = ( Math.sqrt(speed*speed+2*a*distance) - speed )/a;
	var t = (v-speed)/a;
	return tmax>=t ? t+(distance-dist(speed,t))/v : tmax;
}

var tw = w/a;
var dw = dist(0, tw);
if(v<=w||dw>=d){
	print( travel(l, 0) );
}else{
	print( tw + 2*travel(0.5*(d-dw), w)+travel(l-d, w) );
}

// Generated by CoffeeScript 1.4.0
(function() {
  var UniAccel, a, d, l, r, sa, sc, sd, sf, su, sv, sw, td, tf, tu, v, vb, w, _ref, _ref1;

  UniAccel = {
    vel_change_disp: function(v0, v1, a) {
      return (v1 * v1 - v0 * v0) / (2 * a);
    },
    disp_time: function(s, v0, a) {
      return (Math.sqrt(v0 * v0 + 2 * a * s) - v0) / a;
    }
  };

  _ref = readline().split(' ').map(function(x) {
    return parseInt(x);
  }), a = _ref[0], v = _ref[1];

  _ref1 = readline().split(' ').map(function(x) {
    return parseInt(x);
  }), l = _ref1[0], d = _ref1[1], w = _ref1[2];

  sw = UniAccel.vel_change_disp(0, w, a);

  sv = UniAccel.vel_change_disp(0, v, a);

  if (w > v || sw >= d) {
    if (sv > l) {
      print(UniAccel.disp_time(l, 0, a).toFixed(5));
    } else {
      print((v / a + (l - sv) / v).toFixed(5));
    }
  } else {
    sf = UniAccel.vel_change_disp(w, v, a);
    tf = 0;
    r = l - d;
    if (sf > r) {
      tf = UniAccel.disp_time(r, w, a);
    } else {
      tf = UniAccel.disp_time(sf, w, a) + (r - sf) / v;
    }
    su = UniAccel.vel_change_disp(0, v, a);
    sd = UniAccel.vel_change_disp(v, w, -a);
    sa = su + sd;
    if (sa <= d) {
      sc = d - sa;
      tu = UniAccel.disp_time(su, 0, a);
      td = UniAccel.disp_time(sd, v, -a);
      print((tu + sc / v + td + tf).toFixed(5));
    } else {
      vb = Math.sqrt(a * d + (w * w) / 2);
      su = UniAccel.vel_change_disp(0, vb, a);
      sd = UniAccel.vel_change_disp(vb, w, -a);
      tu = UniAccel.disp_time(su, 0, a);
      td = UniAccel.disp_time(sd, vb, -a);
      print((tu + td + tf).toFixed(5));
    }
  }

}).call(this);

// Generated by CoffeeScript 1.4.0
(function() {
  var UniAccel, a, d, l, sa, sc, sd, sf, su, sv, sw, td, tf, tu, v, vb, w, _ref, _ref1;

  UniAccel = {
    vel_change_disp: function(v0, v1, a) {
      return (v1 * v1 - v0 * v0) / (2 * a);
    },
    disp_time: function(s, v0, a) {
      return (Math.sqrt(v0 * v0 + 2 * a * s) - v0) / a;
    }
  };

  _ref = readline().split(' ').map(function(x) {
    return parseInt(x);
  }), a = _ref[0], v = _ref[1];

  _ref1 = readline().split(' ').map(function(x) {
    return parseInt(x);
  }), l = _ref1[0], d = _ref1[1], w = _ref1[2];

  sw = UniAccel.vel_change_disp(0, w, a);

  sv = UniAccel.vel_change_disp(0, v, a);

  if (w > v || sw >= d) {
    if (sv > l) {
      print(UniAccel.disp_time(l, 0, a).toFixed(5));
    } else {
      print((v / a + (l - sv) / v).toFixed(5));
    }
  } else {
    sf = UniAccel.vel_change_disp(w, v, a);
    tf = UniAccel.disp_time(sf, w, a) + (l - d - sf) / v;
    su = UniAccel.vel_change_disp(0, v, a);
    sd = UniAccel.vel_change_disp(v, w, -a);
    sa = su + sd;
    if (sa <= d) {
      sc = d - sa;
      tu = UniAccel.disp_time(su, 0, a);
      td = UniAccel.disp_time(sd, v, -a);
      print((tu + sc / v + td + tf).toFixed(5));
    } else {
      vb = Math.sqrt(a * d + (w * w) / 2);
      su = UniAccel.vel_change_disp(0, vb, a);
      sd = UniAccel.vel_change_disp(vb, w, -a);
      tu = UniAccel.disp_time(su, 0, a);
      td = UniAccel.disp_time(sd, vb, -a);
      print((tu + td + tf).toFixed(5));
    }
  }

}).call(this);

// Generated by CoffeeScript 1.4.0
(function() {
  var UniAccel, a, d, l, r, sa, sc, sd, sf, su, sv, sw, td, tf, tu, v, vb, w, _ref, _ref1;

  UniAccel = {
    vel_change_disp: function(v0, v1, a) {
      return (v1 * v1 - v0 * v0) / (2 * a);
    },
    disp_time: function(s, v0, a) {
      return (Math.sqrt(v0 * v0 + 2 * a * s) - v0) / a;
    }
  };

  _ref = readline().split(' ').map(function(x) {
    return parseInt(x);
  }), a = _ref[0], v = _ref[1];

  _ref1 = readline().split(' ').map(function(x) {
    return parseInt(x);
  }), l = _ref1[0], d = _ref1[1], w = _ref1[2];

  sw = UniAccel.vel_change_disp(0, w, a);

  sv = UniAccel.vel_change_disp(0, v, a);

  if (w > v || sw >= d) {
    if (sv > l) {
      print(1);
      print(UniAccel.disp_time(l, 0, a).toFixed(5));
    } else {
      print(2);
      print((v / a + (l - sv) / v).toFixed(5));
    }
  } else {
    sf = UniAccel.vel_change_disp(w, v, a);
    tf = 0;
    r = l - d;
    if (sf > r) {
      tf = UniAccel.disp_time(r, w, a);
    } else {
      tf = UniAccel.disp_time(sf, w, a) + (r - sf) / v;
    }
    su = UniAccel.vel_change_disp(0, v, a);
    sd = UniAccel.vel_change_disp(v, w, -a);
    sa = su + sd;
    if (sa <= d) {
      print(3);
      sc = d - sa;
      tu = UniAccel.disp_time(su, 0, a);
      td = UniAccel.disp_time(sd, v, -a);
      print((tu + sc / v + td + tf).toFixed(5));
    } else {
      print(4);
      vb = Math.sqrt(a * d + (w * w) / 2);
      su = UniAccel.vel_change_disp(0, vb, a);
      sd = UniAccel.vel_change_disp(vb, w, -a);
      tu = UniAccel.disp_time(su, 0, a);
      td = UniAccel.disp_time(sd, vb, -a);
      print((tu + td + tf).toFixed(5));
    }
  }

}).call(this);

// Generated by CoffeeScript 1.4.0
(function() {
  var UniAccel, a, d, l, sa, sc, sd, su, sv, sw, td, tf, tu, v, vb, w, _ref, _ref1;

  UniAccel = {
    vel_change_disp: function(v0, v1, a) {
      return (v1 * v1 - v0 * v0) / (2 * a);
    },
    disp_time: function(s, v0, a) {
      return (Math.sqrt(v0 * v0 + 2 * a * s) - v0) / a;
    }
  };

  _ref = readline().split(' ').map(function(x) {
    return parseInt(x);
  }), a = _ref[0], v = _ref[1];

  _ref1 = readline().split(' ').map(function(x) {
    return parseInt(x);
  }), l = _ref1[0], d = _ref1[1], w = _ref1[2];

  sw = UniAccel.vel_change_disp(0, w, a);

  sv = UniAccel.vel_change_disp(0, v, a);

  if (w > v || sw >= d) {
    if (sv > l) {
      print(UniAccel.disp_time(l, 0, a).toFixed(5));
    } else {
      print((v / a + (l - sv) / v).toFixed(5));
    }
  } else {
    tf = UniAccel.disp_time(l - d, w, a);
    su = UniAccel.vel_change_disp(0, v, a);
    sd = UniAccel.vel_change_disp(v, w, -a);
    sa = su + sd;
    if (sa <= d) {
      sc = d - sa;
      tu = UniAccel.disp_time(su, 0, a);
      td = UniAccel.disp_time(sd, v, -a);
      print((tu + sc / v + td + tf).toFixed(5));
    } else {
      vb = Math.sqrt(a * d + (w * w) / 2);
      su = UniAccel.vel_change_disp(0, vb, a);
      sd = UniAccel.vel_change_disp(vb, w, -a);
      tu = UniAccel.disp_time(su, 0, a);
      td = UniAccel.disp_time(sd, vb, -a);
      print((tu + td + tf).toFixed(5));
    }
  }

}).call(this);


Olga came to visit the twins Anna and Maria and saw that they have many cookies. The cookies are distributed into bags. As there are many cookies, Olga decided that it's no big deal if she steals a bag. However, she doesn't want the sisters to quarrel because of nothing when they divide the cookies. That's why Olga wants to steal a bag with cookies so that the number of cookies in the remaining bags was even, that is, so that Anna and Maria could evenly divide it into two (even 0 remaining cookies will do, just as any other even number). How many ways there are to steal exactly one cookie bag so that the total number of cookies in the remaining bags was even?

The first line contains the only integer n (1 ≤ n ≤ 100) — the number of cookie bags Anna and Maria have. The second line contains n integers ai (1 ≤ ai ≤ 100) — the number of cookies in the i-th bag.

Print in the only line the only number — the sought number of ways. If there are no such ways print 0.

NoteIn the first sample Olga should take the only bag so that the twins ended up with the even number of cookies.In the second sample Olga can take any of five bags with two cookies or any of three bags with four cookies — 5 + 3 = 8 ways in total.In the third sample, no matter which bag with two cookies Olga chooses, the twins are left with 2 * 9 + 99 = 117 cookies. Thus, Olga has only one option: to take the bag with 99 cookies.

"use strict";

var n = readline();
var a = readline().split(' ').map(Number);
var sum = 0, even = 0;
for(var i = 0; i < n; i++) {
    sum += a[i];
    if (a[i] % 2 === 0) { even++; }
}
if (sum % 2 === 0) {
    print(even);
} else {
    print(n - even);
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (d) => {
  if (c === 0) {
    c++;
    return;
  }

  const arr = d.split(' ').map(Number);
  let sum = arr.reduce((a, b) => a + b, 0);
  let ans = 0;

  arr.forEach(x => (sum - x) % 2 === 0 && ans++);

  console.log(ans);

  c++;
});

readline();
var a=readline().split(' ').map(Number);
var p=a.reduce(function(a,b){return a+b;})%2;
print(a.filter(function(v){return v%2===p;}).length);

;(function () {

	var n = +readline();
	if (n == 1) {
		print(1);
		return;
	}

	var p = readline().split(' ');
	var s = p.reduce(function (p, e) { return p + +e; }, 0);

	var x = 0;
	p.forEach(function (e) {
		if (! ((s - e) % 2)) x++;
	});

	print(x);

}).call(this);

var limit = readline()
var values = readline().split(" ")
var sum = 0;
var count = 0;
for(var i = 0; i < values.length; i++){
    sum += parseInt(values[i])
}

for(var i = 0; i < values.length; i++){
    if((sum - parseInt(values[i])) % 2 == 0){
        count++
    }
}

print(count)

n = +readline();
a = readline().split(' ').map(Number);

tot = 0 ;
for (i = 0 ; i < n ; i ++)
{
    tot += a[i];
}
var res = 0;
for (var i = 0 ; i < n ; i ++)
{
    rem = tot - a[i];
    if (rem % 2 === 0 )
    {
        res ++;
    }
}
write(res);

var n = Number(readline());
var a = readline().split(' ').map(Number);
var c = [0, 0];
for (var i = 0; i < n; i++) {
    if (a[i] % 2 === 0) c[0]++;
    else c[1]++;
}
if (c[1] % 2 === 0) {
    print(c[0]);
} else {
    print(c[1]);
}

n = +readline();
a = readline().split(' ').map(Number);
write(a);

tot = 0 ;
for (i = 0 ; i < n ; i ++)
{
    tot += a[i];
}
var res = 0;
for (var i = 0 ; i < n ; i ++)
{
    rem = tot - a[i];
    if (rem % 2 === 0 )
    {
        res ++;
    }
}
write(res);

n = +readline();
a = readline().split(' ').map(parseInt);

tot = 0 ;
for (i = 0 ; i < n ; i ++)
{
    tot += a[i];
}
var res = 0;
for (var i = 0 ; i < n ; i ++)
{
    rem = tot - a[i];
    if (rem % 2 === 0 )
    {
        res ++;
    }
}
write(res);