import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.InputMismatchException;

public class R111_D2_A {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        // BufferedReader in = new BufferedReader(new
        // InputStreamReader(System.in));
        int n = in.readInt();
        int[] inp = new int[n];
        for (int i = 0; i < inp.length; i++) {
            inp[i] = in.readInt();
        }
        Arrays.sort(inp);
        int sum1 = 0;
        int res = 0;
        for (int i = inp.length - 1; i >= 0; i--) {
            sum1 += inp[i];
            res++;
            int sum2 = 0;
            for (int j = 0; j < i; j++) {
                sum2 += inp[j];
            }
            if (sum1 > sum2) {
                break;
            }
        }
        System.out.println(res);
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1000];
        private int curChar, numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                 ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?