There are n boxes with colored balls on the table. Colors are numbered from 1 to n. i-th box contains ai balls, all of which have color i. You have to write a program that will divide all balls into sets such that:

  * each ball belongs to exactly one of the sets, 
  * there are no empty sets, 
  * there is no set containing two (or more) balls of different colors (each set contains only balls of one color), 
  * there are no two sets such that the difference between their sizes is greater than 1. 



Print the minimum possible number of sets.

Input

The first line contains one integer number n (1 ≤ n ≤ 500).

The second line contains n integer numbers a1, a2, ... , an (1 ≤ ai ≤ 109).

Output

Print one integer number — the minimum possible number of sets.

Examples

Input

3
4 7 8


Output

5


Input

2
2 7


Output

4

Note

In the first example the balls can be divided into sets like that: one set with 4 balls of the first color, two sets with 3 and 4 balls, respectively, of the second color, and two sets with 4 balls of the third color.
import java.io.*;
import java.math.*;
import java.security.KeyStore.Entry;
import java.util.*;

public class TestClass {
	private static InputStream stream;
	private static byte[] buf = new byte[1024];
	private static int curChar;
	private static int numChars;
	private static SpaceCharFilter filter;
	private static PrintWriter pw;
	
	private static void soln() {
		int n = nI();
		int arr[] = new int[n];
		long ans = Long.MAX_VALUE;
		int min = Integer.MAX_VALUE,max = 0;
		for(int i=0;i<n;i++){
			arr[i] = nI();
			min = Math.min(min, arr[i]);
			max = Math.max(max, arr[i]);
		}
		max = Math.min(min,(int) Math.sqrt(max));
		for(int i=0;i<=max;i++){
			long tem = 0;
			long am = min/(i+1);
			int j;
			if(am==0)
				continue;
			for(j=0;j<n;j++){
				long pm = arr[j]/(am+1);
				long pp = arr[j]%(am+1);
				if((pp==0)||(pm+pp>=am))
					tem+=pp==0?pm:pm+1;
				else
					break;
			}
			if(j==n)
				ans = Math.min(ans,tem);
			else{
				tem=0;
				for(j=0;j<n;j++){
					long pm = arr[j]/(am);
					long pp = arr[j]%(am);
					if((pp==0)||(pm+pp>=am-1))
						tem+=pp==0?pm:pm+1;
					else
						break;
				}
				if(j==n)
					ans = Math.min(ans,tem);
			}
		}
		pw.println(ans);
	}

	public static void main(String[] args) {
		InputReader(System.in);
		pw = new PrintWriter(System.out);
		soln();
		pw.close();
	}

	// To Get Input
	// Some Buffer Methods
	public static void InputReader(InputStream stream1) {
		stream = stream1;
	}

	private static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private static boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

	private static 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++];
	}

	private static int nI() {
		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')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private static long nL() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private static String nextToken() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	private static String nLi() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	private static boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	private interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}