#include int main() { int x,y,z; int room[100]; int i = 0; int sum = 0; scanf("%d\n", x); scanf("%d\n", y); scanf("%d\n", z); while(i < z){ scanf("%d\n", room[i]); i++; } i = 0; while(i < z){ if(room[i] == room[i + 1]){ sum += 1; } i++; } printf("%d\n", sum * (x + y)); return (0); }