#!/usr/bin/python3 # @EXPECTED_RESULTS@: ACCEPTED, TIME_LIMIT_EXCEEDED (a, b, c), ws, ps = map(int, input().split()), input(), input() for w in ws: strand, use = 0, c # Why the HECK is using `2_000_000_000` here so much slower than `use + b + c`??? for p in ps: strand, use = [min(strand, use + c), 2_000_000_000][p == w], min(strand + c, use) + [a, b][p == w] print(min(strand, use + c))