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 string

[n, k, m] = map(int, input().split())

arr = list(map(int, input().split()))

my_string = ''

for i in arr:

  my_string += str(i)

#print(string)
checker = set()

for c in arr:
    checker.add(str(c)*k)



if len(checker) == 1:
  print ((n * m) % k)

else:

  ans = n * m

  checker = list(checker)

  #print(checker)

  for i in range(len(checker) + 1):

    if i == len(checker):
      break

    if checker[i] in my_string:


      my_string = my_string.replace(checker[i] , '', 1)
      i = 0
      ans -= k * m


  two_string = my_string * 2

  r = m % 2
  q = m // 2

  for i in range(len(checker)):

    if checker[i] in two_string:


      two_string = two_string.replace(checker[i] , '', 1)

      #two_string = two_string.replace(checker[i], '')
      print(two_string)

      ans -= k * (m -1)
      break


  i = 0

  while len(two_string) > 0 and i < len(checker):


      if  checker[i] == two_string :
         print(r, my_string)
         ans = r * len(my_string)
         break


      if checker[i] in two_string or checker[i] == two_string:

        two_string = two_string.replace(checker[i] , '', 1)

        #two_string = two_string.replace(checker[i], '')
        print(two_string)
        i = 0
        ans -= k * q
        print(ans)




      i += 1


  # for i in range(len(checker) + 1):
  #
  #     if i == len(checker):
  #         break
  #
  #     if checker[i] in two_string:
  #
  #       two_string = two_string.replace(checker[i] , '', 1)
  #
  #       #two_string = two_string.replace(checker[i], '')
  #       print(two_string)
  #       i = 0
  #       ans -= k * q


  print(ans)
