Problem:
Score : 66 points

Problem Statement

Summer vacation ended at last and the second semester has begun.
You, a Kyoto University student, came to university and heard a rumor that somebody will barricade the entrance of your classroom.
The barricade will be built just before the start of the A-th class and removed by Kyoto University students just before the start of the B-th class.
All the classes conducted when the barricade is blocking the entrance will be cancelled and you will not be able to attend them.
Today you take N classes and class i is conducted in the t_i-th period.
You take at most one class in each period.
Find the number of classes you can attend.

Constraints

1 \leq N \leq 1000

1 \leq A < B \leq 10^9

1 \leq t_i \leq 10^9

All t_i values are distinct.

Input

N, A and B are given on the first line and t_i is given on the (i+1)-th line.

N A B
t1
:
tN

Output

Print the number of classes you can attend.

Sample Input 1

5 5 9
4
3
6
9
1

Sample Output 1

4

You can not only attend the third class.

Sample Input 2

5 4 9
5
6
7
8
9

Sample Output 2

1

You can only attend the fifth class.

Sample Input 3

4 3 6
9
6
8
1

Sample Output 3

4

You can attend all the classes.

Sample Input 4

2 1 2
1
2

Sample Output 4

1

You can not attend the first class, but can attend the second.

Solution in Rust (1.15.1) (judge verdict: Accepted)

///////////////////////////////////////////// Template /////////////////////////////////////////////
#![allow(non_snake_case, unused)]
use std::io::Write;
use std::collections::*;

macro_rules! debug {
	($($v: expr),*) => {
		$(let _ = write!(::std::io::stderr(), "{} = {:?} ", stringify!($v), $v);)*
		let _ = writeln!(::std::io::stderr(), "@ {}:{}", file!(), line!());
	}
}
macro_rules! mat {
	($e:expr) => { $e };
	($e:expr; $d:expr $(; $ds:expr)*) => { vec![mat![$e $(; $ds)*]; $d] };
}
macro_rules! ok {
	($a:ident$([$i:expr])*.$f:ident()$(@$t:ident)*) => {
		$a$([$i])*.$f($($t),*)
	};
	($a:ident$([$i:expr])*.$f:ident($e:expr$(,$es:expr)*)$(@$t:ident)*) => { {
		let t = $e;
		ok!($a$([$i])*.$f($($es),*)$(@$t)*@t)
	} };
}
mod template {
	type I<'a> = ::std::iter::Peekable<::std::str::SplitWhitespace<'a>>;
	pub trait FromLn<'a> {
		fn fromln(&mut I<'a>) -> Self;
	}
	pub fn readln<T: for<'a> FromLn<'a>>() -> T {
		let mut buf = String::new();
		let _ = ::std::io::stdin().read_line(&mut buf).unwrap_or_else(|e| panic!("{}", e));
		let mut it = buf.split_whitespace().peekable();
		let t = T::fromln(&mut it);
		if it.peek().is_some() { panic!("input mismatch") }
		t
	}
	pub fn readlns<T: for<'a> FromLn<'a>>(n: usize) -> Vec<T> {
		(0..n).map(|_| readln()).collect()
	}
	macro_rules! read_primitives {
		($($t:ty),*) => { $(
			impl<'a> FromLn<'a> for $t {
				fn fromln(it: &mut I<'a>) -> $t {
					it.next().unwrap_or_else(|| panic!("input mismatch")).parse().unwrap_or_else(|e| panic!("{}", e))
				}
			}
		)* }
	}
	read_primitives!(String, bool, f64, i32, i64, usize, u32, u64);
	impl<'a, T> FromLn<'a> for Vec<T> where T: for<'b> FromLn<'b> {
		fn fromln(it: &mut I) -> Vec<T> {
			let mut vs = vec![];
			while it.peek().is_some() {
				vs.push(T::fromln(it));
			}
			vs
		}
	}
	impl<'a> FromLn<'a> for Vec<char> {
		fn fromln(it: &mut I) -> Vec<char> {
			String::fromln(it).chars().collect()
		}
	}
	impl<'a> FromLn<'a> for Vec<u8> {
		fn fromln(it: &mut I) -> Vec<u8> {
			String::fromln(it).into()
		}
	}
	macro_rules! read_tuple {
		($($t:ident),*) => {
			impl<'a, $($t),*> FromLn<'a> for ($($t),*) where $($t: for<'b> FromLn<'b>),* {
				fn fromln(it: &mut I) -> ($($t),*) {
					($($t::fromln(it)),*)
				}
			}
		}
	}
	read_tuple!(A, B);
	read_tuple!(A, B, C);
	read_tuple!(A, B, C, D);
	pub trait SetMin {
		fn setmin(&mut self, v: Self) -> bool;
	}
	impl<T> SetMin for T where T: PartialOrd {
		fn setmin(&mut self, v: T) -> bool {
			*self > v && { *self = v; true }
		}
	}
	pub trait SetMax {
		fn setmax(&mut self, v: Self) -> bool;
	}
	impl<T> SetMax for T where T: PartialOrd {
		fn setmax(&mut self, v: T) -> bool {
			*self < v && { *self = v; true }
		}
	}
}
use self::template::*;
pub fn main() {
	let _ = writeln!(::std::io::stderr(), "----- {} -----", file!());
	let _ = ::std::thread::Builder::new().name("run".to_string()).stack_size(32 * 1024 * 1024).spawn(run).unwrap().join();
}
////////////////////////////////////////////////////////////////////////////////////////////////////

fn run() {
	let (N, A, B) = readln::<(usize, i32, i32)>();
	let mut ans = 0;
	for t in readlns(N) {
		if t < A || B <= t {
			ans += 1;
		}
	}
	println!("{}", ans);
}