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.
/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.math.*;
import java.util.*;

public class Driver {

	InputStream in;
	PrintWriter out;
	
	
	void solve() {
		int n=ni();
		int a[]=na(n);
		Arrays.sort(a);
		
		int setSize=a[0]+1;
		boolean toggle=true;
		long total=0;
		int idx=2;
		while (setSize>0)
		{
			//tr(setSize);
				total=0;
				boolean flag=true;
				if (a[0]%setSize==0)
				{
					total+=a[0]/setSize;
				}
				else
				{
					long r=a[0]%setSize;
					long r2=r%(setSize-1);
					if (r2==0)
						r2=setSize-1;
					long r3=setSize-1-r2;
					
					long low=r3*setSize+r;
					long remaining=a[0]-low;
					
					//tr(r+" "+r2+" "+r3+" "+low+" "+remaining);
					if (remaining<0)
					{
						if (toggle)
						{
							setSize--;
							toggle=false;
						}
						else
						{
							toggle=true;
							setSize=a[0]/idx+1;
							idx++;
						}
						continue;
					}
					else
						total+=low/(setSize-1)+remaining/setSize;
				}
				
			//	tr(total);
				
				for (int i=1;i<n;i++)
				{
					
					if (a[i]%setSize==0)
					{
						total+=a[i]/setSize;
					}
					else
					{
						long r=a[i]%setSize;
						long r2=r%(setSize-1);
						if (r2==0)
							r2=setSize-1;
						long r3=setSize-1-r2;
						
						long low=r3*setSize+r;
						long remaining=a[i]-low;
						//tr(r+" "+r2+" "+r3+" "+low+" "+remaining);
						if (remaining<0)
						{
							flag=false;
							break;
						}
						else
							total+=low/(setSize-1)+remaining/setSize;
					}
					//tr(total);
				}
				
				if (flag)
					break;
				
				if (toggle)
					{
						setSize--;
						toggle=false;
					}
				else
				{
					toggle=true;
					setSize=a[0]/idx+1;
					idx++;
				}
			}
		out.println(total);
		out.close();
	}

	
	

	void run() throws Exception {
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);

			long s = System.currentTimeMillis();
			solve();
			out.flush();
			tr(System.currentTimeMillis() - s + "ms");
	}

	

	public static void main(String[] args) throws Exception {
		new Driver().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = in.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean inSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(b))
			;
		return b;
	}

	private double nd() {
		return Double.parseDouble(ns());
	}

	private char nc() {
		return (char) skip();
	}

	private String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(inSpaceChar(b))) { // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o) {
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}

}

