// Arup Guha
// 11/8/2009
// My Solution to 2009 SE Regional Problem D: Knitting

import java.util.*;
import java.io.*;

public class d {
	
	public static void main(String[] args) throws Exception {
		
		Scanner fin = new Scanner(new File("d.in"));
		
		// Get input.
		int n = fin.nextInt();
		int m = fin.nextInt(); 
		int k = fin.nextInt();
		
		while (n!=0 || m!=0 || k!=0) {
			
			// Read in all the changes in the pattern.
			int[] delta = new int[k];
			for (int i=0; i<k; i++)
				delta[i] = fin.nextInt();
				
			// Initial settings for both.
			int sum = 0;
			int curstitch = n;
			
			// Go through each row.
			for (int i=0; i<m; i++) {
				
				// Add in the stitches for this row.
				sum += curstitch;
				
				// Adjust the number of stitches for the next row.
				// Use mod in the index so the pattern repeats.
				curstitch += delta[i%k];
			}
			
			// Print the answer.
			System.out.println(sum);
			
			// Get the next input case.
			n = fin.nextInt();
			m = fin.nextInt(); 
			k = fin.nextInt();

		}
		
		fin.close();
	}
}