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