10 5 1000000000
1 1 1 2 2 1 2 2 2 2
 5 3 3
1 2 2 1 1
 2 4 1
1 1
 1 1000000000 1000000000
100000
 5 3 2
1 1 2 1 1
 5 2 4
1 2 3 2 1
 1 10 10
1

10000000000
 0
 2
 0
 7
 0
 0


import java.util.*;

public class Solution {

    public static void main(String[] args) throws java.lang.Exception {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int m = in.nextInt();
        int a;
        String ch = "";
        Stack<Integer> pileA = new Stack<>();
        for (int i = 0; i < n; i++) {
            a = in.nextInt();
            ch = a + " ";
            pileA.push(a);
        }
        if (n == 1) {
            System.out.println(m % k);
        } else {
            String ch2 = "";
            for (int i = 0; i < m; i++) {
                ch2 = ch2.concat(ch);
            }
            Stack<String> pile = new Stack<>();
            for (Integer i : pileA) {
                ch = "";
                for (int j = 0; j < k; j++) {
                    ch = i + " ";
                }
                pile.push(ch);
            }
            boolean trouve;
            do {
                trouve = false;
                for (String string : pile) {
                    while (ch2.contains(string)) {
                        ch2 = ch2.replace(string, "");
                        trouve = true;
                    }
                }
            } while (trouve);
            String[] line = ch2.split(" +");
            if (line[0].equals("")) {
                System.out.println("0");
            } else {
                System.out.println(line.length);
            }
        }
    }
}
