import java.util.Scanner;

public class task1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long k = scanner.nextLong();
        long[] a = new long[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = scanner.nextLong();
        }
        int maxInd = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i] > a[maxInd])
                maxInd = i;
            for (int j = 0; j < a.length; j++) {
                while(a[j] < k && a[maxInd] > a[j] && a[j] != 0 && a[maxInd] % a[i] != 0){
                    a[maxInd]--;
                    a[j]++;
                }
            }
        }
        long count = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i] <= k && a[i] != 0)
                count++;
            else if (a[i] >k) {
                while (a[i] > k | a[i] > 0) {
                    if (a[i] % k == 0) {
                        count += a[i] / k;
                        break;
                    } else {
                        count += a[i] / k;
                        a[i] /= k;
                    }
                    if (a[i] == 1) {
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    }
}