import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readD(in.readLine());
		// for (; solver.hasNext();) {
		// solver.readBody(in.readLine());
		// }
		// solver.solve();
	}
}

class Solver {
	int N;
	int cnt;

	public void init() {
		N = 0;
		cnt = 0;
	}

	public void readHead(String str) {
		String[] strArr = str.split("\\s+");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	}

	public void readD(String str) {
		String[] strArr = str.split("\\s+");
		HashMap<Integer, Integer> hist = new HashMap<Integer, Integer>();
		int dmax = 1;
		for (int i = 0; i < N; i++) {
			int d = Integer.parseInt(strArr[i]);
			if (hist.containsKey(d)) {
				hist.put(d, hist.get(d) + 1);
			} else {
				hist.put(d, 1);
			}
			if (d > dmax)
				dmax = d;
		}
		int cnt = 0;
		int h = 0;
		for (int i = 0; i < dmax && h <= N / 2; i++) {
			if (hist.containsKey(i)) {
				h += hist.get(i);
			}
			if (h == N / 2)
				cnt++;
		}
		System.out.println(cnt);
	}

	public boolean hasNext() {
		return cnt < N;
	}

	public void readBody(String str) {
		// System.out.println(str);
		cnt++;
	}

	public void solve() {

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.HashMap; HashMap java.util class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readD(in.readLine());
		// for (; solver.hasNext();) {
		// solver.readBody(in.readLine());
		// }
		// solver.solve();
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readD(in.readLine());
		// for (; solver.hasNext();) {
		// solver.readBody(in.readLine());
		// }
		// solver.solve();
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readD(in.readLine());
		// for (; solver.hasNext();) {
		// solver.readBody(in.readLine());
		// }
		// solver.solve();
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) Solver solver = new Solver(); solver new Solver() solver.init() solver.init solver solver.readHead(in.readLine()) solver.readHead solver in.readLine() in.readLine in solver.readD(in.readLine()) solver.readD solver in.readLine() in.readLine in String args[] args class Solver {
	int N;
	int cnt;

	public void init() {
		N = 0;
		cnt = 0;
	}

	public void readHead(String str) {
		String[] strArr = str.split("\\s+");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	}

	public void readD(String str) {
		String[] strArr = str.split("\\s+");
		HashMap<Integer, Integer> hist = new HashMap<Integer, Integer>();
		int dmax = 1;
		for (int i = 0; i < N; i++) {
			int d = Integer.parseInt(strArr[i]);
			if (hist.containsKey(d)) {
				hist.put(d, hist.get(d) + 1);
			} else {
				hist.put(d, 1);
			}
			if (d > dmax)
				dmax = d;
		}
		int cnt = 0;
		int h = 0;
		for (int i = 0; i < dmax && h <= N / 2; i++) {
			if (hist.containsKey(i)) {
				h += hist.get(i);
			}
			if (h == N / 2)
				cnt++;
		}
		System.out.println(cnt);
	}

	public boolean hasNext() {
		return cnt < N;
	}

	public void readBody(String str) {
		// System.out.println(str);
		cnt++;
	}

	public void solve() {

	}
} Solver int N; N int cnt; cnt public void init() {
		N = 0;
		cnt = 0;
	} init {
		N = 0;
		cnt = 0;
	} N = 0 N 0 cnt = 0 cnt 0 public void readHead(String str) {
		String[] strArr = str.split("\\s+");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	} readHead {
		String[] strArr = str.split("\\s+");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	} String[] strArr = str.split("\\s+"); strArr str.split("\\s+") str.split str "\\s+" N = Integer.parseInt(strArr[0]) N Integer.parseInt(strArr[0]) Integer.parseInt Integer strArr[0] strArr 0 String str str public void readD(String str) {
		String[] strArr = str.split("\\s+");
		HashMap<Integer, Integer> hist = new HashMap<Integer, Integer>();
		int dmax = 1;
		for (int i = 0; i < N; i++) {
			int d = Integer.parseInt(strArr[i]);
			if (hist.containsKey(d)) {
				hist.put(d, hist.get(d) + 1);
			} else {
				hist.put(d, 1);
			}
			if (d > dmax)
				dmax = d;
		}
		int cnt = 0;
		int h = 0;
		for (int i = 0; i < dmax && h <= N / 2; i++) {
			if (hist.containsKey(i)) {
				h += hist.get(i);
			}
			if (h == N / 2)
				cnt++;
		}
		System.out.println(cnt);
	} readD {
		String[] strArr = str.split("\\s+");
		HashMap<Integer, Integer> hist = new HashMap<Integer, Integer>();
		int dmax = 1;
		for (int i = 0; i < N; i++) {
			int d = Integer.parseInt(strArr[i]);
			if (hist.containsKey(d)) {
				hist.put(d, hist.get(d) + 1);
			} else {
				hist.put(d, 1);
			}
			if (d > dmax)
				dmax = d;
		}
		int cnt = 0;
		int h = 0;
		for (int i = 0; i < dmax && h <= N / 2; i++) {
			if (hist.containsKey(i)) {
				h += hist.get(i);
			}
			if (h == N / 2)
				cnt++;
		}
		System.out.println(cnt);
	} String[] strArr = str.split("\\s+"); strArr str.split("\\s+") str.split str "\\s+" HashMap<Integer, Integer> hist = new HashMap<Integer, Integer>(); hist new HashMap<Integer, Integer>() int dmax = 1; dmax 1 for (int i = 0; i < N; i++) {
			int d = Integer.parseInt(strArr[i]);
			if (hist.containsKey(d)) {
				hist.put(d, hist.get(d) + 1);
			} else {
				hist.put(d, 1);
			}
			if (d > dmax)
				dmax = d;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			int d = Integer.parseInt(strArr[i]);
			if (hist.containsKey(d)) {
				hist.put(d, hist.get(d) + 1);
			} else {
				hist.put(d, 1);
			}
			if (d > dmax)
				dmax = d;
		} {
			int d = Integer.parseInt(strArr[i]);
			if (hist.containsKey(d)) {
				hist.put(d, hist.get(d) + 1);
			} else {
				hist.put(d, 1);
			}
			if (d > dmax)
				dmax = d;
		} int d = Integer.parseInt(strArr[i]); d Integer.parseInt(strArr[i]) Integer.parseInt Integer strArr[i] strArr i if (hist.containsKey(d)) {
				hist.put(d, hist.get(d) + 1);
			} else {
				hist.put(d, 1);
			} hist.containsKey(d) hist.containsKey hist d {
				hist.put(d, hist.get(d) + 1);
			} hist.put(d, hist.get(d) + 1) hist.put hist d hist.get(d) + 1 hist.get(d) hist.get hist d 1 {
				hist.put(d, 1);
			} hist.put(d, 1) hist.put hist d 1 if (d > dmax)
				dmax = d; d > dmax d dmax dmax = d dmax d int cnt = 0; cnt 0 int h = 0; h 0 for (int i = 0; i < dmax && h <= N / 2; i++) {
			if (hist.containsKey(i)) {
				h += hist.get(i);
			}
			if (h == N / 2)
				cnt++;
		} int i = 0; int i = 0; i 0 i < dmax && h <= N / 2 i < dmax i dmax h <= N / 2 h N / 2 N 2 i++ i++ i {
			if (hist.containsKey(i)) {
				h += hist.get(i);
			}
			if (h == N / 2)
				cnt++;
		} {
			if (hist.containsKey(i)) {
				h += hist.get(i);
			}
			if (h == N / 2)
				cnt++;
		} if (hist.containsKey(i)) {
				h += hist.get(i);
			} hist.containsKey(i) hist.containsKey hist i {
				h += hist.get(i);
			} h += hist.get(i) h hist.get(i) hist.get hist i if (h == N / 2)
				cnt++; h == N / 2 h N / 2 N 2 cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String str str public boolean hasNext() {
		return cnt < N;
	} hasNext {
		return cnt < N;
	} return cnt < N; cnt < N cnt N public void readBody(String str) {
		// System.out.println(str);
		cnt++;
	} readBody {
		// System.out.println(str);
		cnt++;
	} cnt++ cnt String str str public void solve() {

	} solve {

	}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readD(in.readLine());
		// for (; solver.hasNext();) {
		// solver.readBody(in.readLine());
		// }
		// solver.solve();
	}
}

class Solver {
	int N;
	int cnt;

	public void init() {
		N = 0;
		cnt = 0;
	}

	public void readHead(String str) {
		String[] strArr = str.split("\\s+");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	}

	public void readD(String str) {
		String[] strArr = str.split("\\s+");
		HashMap<Integer, Integer> hist = new HashMap<Integer, Integer>();
		int dmax = 1;
		for (int i = 0; i < N; i++) {
			int d = Integer.parseInt(strArr[i]);
			if (hist.containsKey(d)) {
				hist.put(d, hist.get(d) + 1);
			} else {
				hist.put(d, 1);
			}
			if (d > dmax)
				dmax = d;
		}
		int cnt = 0;
		int h = 0;
		for (int i = 0; i < dmax && h <= N / 2; i++) {
			if (hist.containsKey(i)) {
				h += hist.get(i);
			}
			if (h == N / 2)
				cnt++;
		}
		System.out.println(cnt);
	}

	public boolean hasNext() {
		return cnt < N;
	}

	public void readBody(String str) {
		// System.out.println(str);
		cnt++;
	}

	public void solve() {

	}
}
