// Arup Guha
// 3/4/2018
// Solution to 2018 February USACO Bronze Problem: Hoofball

import java.util.*;
import java.io.*;

public class hoofball {

	public static void main(String[] args) throws Exception {

		Scanner stdin = new Scanner(new File("hoofball.in"));

		// Read in the array and sort.
		int n = stdin.nextInt();
		int[] vals = new int[n];
		for (int i=0; i<n; i++)
			vals[i] = stdin.nextInt();
		Arrays.sort(vals);

		// Ta da!
		PrintWriter out = new PrintWriter(new FileWriter("hoofball.out"));
		out.println(solve(vals));
		out.close();
		stdin.close();
	}

	public static int solve(int[] vals) {

		int n = vals.length;

		// Get this case out of the way.
		if (n < 3) return 1;

		// Store which way each cow will pass the ball.
		boolean[] right = new boolean[n];
		right[0] = true;

		// We go right if the left distance is greater than the right distance.
		for (int i=1; i<n-1; i++)
			if (vals[i]-vals[i-1] > vals[i+1]-vals[i])
				right[i] = true;

		int res = 0, i = 0;

		// Sweep through the data.
		while (i < n) {

			// Rights.
			int rCnt = 0;
			while (right[i]) {
				i++;
				rCnt++;
			}

			// Lefts
			int lCnt = 0;
			while (i<n && !right[i]) {
				i++;
				lCnt++;
			}

			// We must come from both sides.
			if (rCnt > 1 && lCnt > 1)
				res += 2;

			// Good enough to come from one side.
			else
				res++;
		}

		return res;
	}
}