n, r, t = gets.chomp.split.map(&:to_i)
runners = []
n.times{
    p = gets.to_i
    runners << [0, p, 0]
}
points = Array.new(r){[0, 0]}

sum = 0
t.times{
    for i in 0...r
        points[i][0] = 0 if points[i][0] < 0
        points[i][0] += points[i][1]
        points[i][1] = 0
    end
    for i in 0...n
        point = (runners[i][0] + runners[i][1]) % r
        points[point][0] -= 1
        points[point][1] += runners[i][2]
        runners[i][0] = point
        runners[i][2] = 1
        sum += 1 if points[point][0] < 0
    end
}
puts sum
