#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 + 1))); while(i < z - 1){ scanf("%d\n", p[i]); i++; } i = 0; while(i < z - 1){ if((i + 1) != z){ p[i] = p[i + 1] ? sum++ : 0; } i++; } printf("%d\n", (sum * (x + y))); return (0); }