import java.io.*;
import java.util.*;
import java.util.concurrent.TimeUnit;

public class d1380 implements Runnable{

    public static void main(String[] args) {
    	try{
            new Thread(null, new d1380(), "process", 1<<26).start();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		//int t = scan.nextInt();
		int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int oo = Integer.MAX_VALUE;
		static final long OO = Long.MAX_VALUE;

		public void solve(int testNumber, FastReader sc, PrintWriter out) {
			int N = sc.nextInt();
			int M = sc.nextInt();

			int X = sc.nextInt();
			int K = sc.nextInt();
			int Y = sc.nextInt();

			int[] a = sc.readArray(N);
			int[] b = sc.readArray(M);

			int[] location = new int[N+1];
			for(int i = 0; i < N; i++) {
				location[a[i]] = i;
			}
			for(int i = 1; i < M; i++) {
				if(location[b[i]] < location[b[i-1]]) {
					out.println(-1);
					return;
				}
			}

			List<Integer> LR = new ArrayList<>();
			LR.add(-1);
			for(int i = 0; i < M; i++) {
				LR.add(location[b[i]]);
			}
			LR.add(N);
			//dbg(LR);

			long total = 0;
			for(int i = 1; i < LR.size(); i++) {
				int R = LR.get(i);
				int L = LR.get(i-1);

				int countHigher = 0;
				for(int j = L+1; j < R; j++) {
					if(a[j] > Math.max(R, L)) {
						countHigher++;
					}
				}

				if(R - L - 1 < K) {
					// only berserk is possible
					if(countHigher > 0) {
						out.println(-1);
						return;
					}
					total += (R - L - 1) * Y;
				} else {
					if(Y * K <= X) {
						// Berserk is better than, or just as good as fireball, so we can greedy it
						if(countHigher == 0) {
							// Berserk all of them
							total += (R - L - 1) * Y;
						} else {
							// Berserk all of them except for the last K, since it will have to be fireballed
							total += (R - L - 1 - K) * Y + X;
						}
					} else {
						// Fireball is better than beserk, so we should fireball as much as possible
						int countLower = (R - L - 1 - countHigher); // number that are able to be "finished off"
						if((R - L - 1) % K > countLower) {
							// there will be a higher one left, and thus impossible
							out.println(-1);
							return;
						} else {
							total += X * ((R - L - 1) / K);
							total += Y * ((R - L - 1) % K);
						}
					}
				}
			}

			out.println(total);
		}
	}

	static long modDivide(long a, long b, long MOD) {
		a %= MOD;
		return (binpow(b, MOD-2, MOD) * a) % MOD;
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static int[] reverse(int a[])
    {
        int[] b = new int[a.length];
        for (int i = 0, j = a.length; i < a.length; i++, j--) {
            b[j - 1] = a[i];
        }

        return b;
    }
	static long[] reverse(long a[])
    {
        long[] b = new long[a.length];
        for (int i = 0, j = a.length; i < a.length; i++, j--) {
            b[j - 1] = a[i];
        }

        return b;
    }
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static void sort(long[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static class tup implements Comparable<tup>, Comparator<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		public tup() {
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(b,o.b);
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Integer.compare(o1.b, o2.b);
		}

		@Override
	    public int hashCode() {
			return Objects.hash(a, b);
	    }

	    @Override
	    public boolean equals(Object obj) {
	    	if (this == obj)
                return true;
	    	if (obj == null)
                return false;
	    	if (getClass() != obj.getClass())
                return false;
	    	tup other = (tup) obj;
	    	return a==other.a && b==other.b;
	    }

	    @Override
	    public String toString() {
	    	return a + " " + b;
	    }
	}

	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		int[] readArray(int size) {
			int[] a = new int[size];
			for(int i = 0; i < size; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		long[] readLongArray(int size) {
			long[] a = new long[size];
			for(int i = 0; i < size; i++) {
				a[i] = nextLong();
			}
			return a;
		}
	}

	static void dbg(int[] arr) {
		System.out.println(Arrays.toString(arr));
	}
	static void dbg(long[] arr) {
		System.out.println(Arrays.toString(arr));
	}
	static void dbg(boolean[] arr) {
		System.out.println(Arrays.toString(arr));
	}

	static void dbg(Object... args) {
        for (Object arg : args)
            System.out.print(arg + " ");
        System.out.println();
    }
}


import java.io.*;
import java.util.*;
import java.util.concurrent.TimeUnit;

public class d1380 implements Runnable{

    public static void main(String[] args) {
    	try{
            new Thread(null, new d1380(), "process", 1<<26).start();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		//int t = scan.nextInt();
		int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int oo = Integer.MAX_VALUE;
		static final long OO = Long.MAX_VALUE;

		public void solve(int testNumber, FastReader sc, PrintWriter out) {
			int N = sc.nextInt();
			int M = sc.nextInt();

			long X = sc.nextInt();
			long K = sc.nextInt();
			long Y = sc.nextInt();

			int[] a = sc.readArray(N);
			int[] b = sc.readArray(M);

			int[] location = new int[N+1];
			for(int i = 0; i < N; i++) {
				location[a[i]] = i;
			}
			for(int i = 1; i < M; i++) {
				if(location[b[i]] < location[b[i-1]]) {
					out.println(-1);
					return;
				}
			}

			List<Integer> LR = new ArrayList<>();
			LR.add(-1);
			for(int i = 0; i < M; i++) {
				LR.add(location[b[i]]);
			}
			LR.add(N);
			//dbg(LR);

			long total = 0;
			for(int i = 1; i < LR.size(); i++) {
				int R = LR.get(i);
				int L = LR.get(i-1);
				int MAX;
				if(L == -1)
					MAX = a[R];
				else if (R == N)
					MAX = a[L];
				else
					MAX = Math.max(a[R], a[L]);

				int countHigher = 0;
				for(int j = L+1; j < R; j++) {
					if(a[j] > MAX) {
						countHigher++;
					}
				}

				if(R - L - 1 < K) {
					// only berserk is possible
					if(countHigher > 0) {
						out.println(-1);
						return;
					}
					total += (R - L - 1) * Y;
				} else {
					if(Y * K <= X) {
						// Berserk is better than, or just as good as fireball, so we can greedy it
						if(countHigher == 0) {
							// Berserk all of them
							total += (R - L - 1) * Y;
						} else {
							// Berserk all of them except for the last K, since it will have to be fireballed
							total += (R - L - 1 - K) * Y + X;
						}
					} else {
						// Fireball is better than beserk, so we should fireball as much as possible
						int countLower = (R - L - 1 - countHigher); // number that are able to be "finished off"
						if((R - L - 1) % K > countLower) {
							// there will be a higher one left, and thus impossible
							out.println(-1);
							return;
						} else {
							total += X * ((R - L - 1) / K);
							total += Y * ((R - L - 1) % K);
						}
					}
				}
			}

			out.println(total);
		}
	}

	static long modDivide(long a, long b, long MOD) {
		a %= MOD;
		return (binpow(b, MOD-2, MOD) * a) % MOD;
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static int[] reverse(int a[])
    {
        int[] b = new int[a.length];
        for (int i = 0, j = a.length; i < a.length; i++, j--) {
            b[j - 1] = a[i];
        }

        return b;
    }
	static long[] reverse(long a[])
    {
        long[] b = new long[a.length];
        for (int i = 0, j = a.length; i < a.length; i++, j--) {
            b[j - 1] = a[i];
        }

        return b;
    }
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static void sort(long[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static class tup implements Comparable<tup>, Comparator<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		public tup() {
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(b,o.b);
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Integer.compare(o1.b, o2.b);
		}

		@Override
	    public int hashCode() {
			return Objects.hash(a, b);
	    }

	    @Override
	    public boolean equals(Object obj) {
	    	if (this == obj)
                return true;
	    	if (obj == null)
                return false;
	    	if (getClass() != obj.getClass())
                return false;
	    	tup other = (tup) obj;
	    	return a==other.a && b==other.b;
	    }

	    @Override
	    public String toString() {
	    	return a + " " + b;
	    }
	}

	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		int[] readArray(int size) {
			int[] a = new int[size];
			for(int i = 0; i < size; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		long[] readLongArray(int size) {
			long[] a = new long[size];
			for(int i = 0; i < size; i++) {
				a[i] = nextLong();
			}
			return a;
		}
	}

	static void dbg(int[] arr) {
		System.out.println(Arrays.toString(arr));
	}
	static void dbg(long[] arr) {
		System.out.println(Arrays.toString(arr));
	}
	static void dbg(boolean[] arr) {
		System.out.println(Arrays.toString(arr));
	}

	static void dbg(Object... args) {
        for (Object arg : args)
            System.out.print(arg + " ");
        System.out.println();
    }
}


import java.util.*;
import java.util.stream.*;
import java.io.*;
import java.math.*;

public class Main {

    static boolean FROM_FILE = false;

    static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            if (FROM_FILE) {
                try {
                    br = new BufferedReader(new FileReader("input.txt"));
                } catch (IOException error) {
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static int max(int... nums) {
        int res = Integer.MIN_VALUE;
        for (int num: nums) res = Math.max(res, num);
        return res;
    }
    static int min(int... nums) {
        int res = Integer.MAX_VALUE;
        for (int num: nums) res = Math.min(res, num);
        return res;
    }
    static long max(long... nums) {
        long res = Long.MIN_VALUE;
        for (long num: nums) res = Math.max(res, num);
        return res;
    }
    static long min(long... nums) {
        long res = Long.MAX_VALUE;
        for (long num: nums) res = Math.min(res, num);
        return res;
    }

    static FastReader fr = new FastReader();
    static PrintWriter out;

    public static void main(String[] args) {
        if (FROM_FILE) {
            try {
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException error) {

            }
        } else {
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        new Main().run();
        out.flush();
        out.close();
    }

    void run() {
        int n = fr.nextInt(), m = fr.nextInt();
        n += 1; m += 1;
        int x = fr.nextInt(), k = fr.nextInt(), y = fr.nextInt();
        boolean xPrior = (long)x < (long)y * (long)k;
        if (LOCAL) {
            out.println((long)x + " " + ((long)y * (long)k) + " " + xPrior);
        }
        int[] a = new int[n], b = new int[m];
        for (int i = 0; i < n - 1; i += 1) a[i] = fr.nextInt();
        for (int i = 0; i < m - 1; i += 1) b[i] = fr.nextInt();
        a[n - 1] = b[m - 1] = (1 << 30) + (1 << 29);
        int i = 0, j = 0, prev = -1;
        long res = 0;
        boolean flag = true;
        if (LOCAL) {
            out.println(Arrays.toString(a));
            out.println(Arrays.toString(b));
        }
        while (j < m) {
            List<Integer> bigger = new ArrayList<>();
            int ni = i, maxVal = -1;
            while (ni < n && a[ni] != b[j]) {
                maxVal = max(maxVal, a[ni]);
                ni += 1;
            }
            if (ni >= n) { flag = false; break; }
            int threshold = max(prev, j < m - 1 ? b[j] : -1);
            int len = ni - i;
            if (LOCAL) {
                out.println(i + " " + ni + " " + len + " " + bigger);
            }
            long item = 0L;
            if (maxVal > threshold) {
                if (len < k) { flag = false; break; }
                item += (long)x;
                int remain = len - k;
                if (xPrior) {
                    item += (long)remain / k * (long)x;
                    item += (long)remain % k * (long)y;
                } else {
                    item += (long)remain * (long)y;
                }
            } else {
                if (xPrior) {
                    item += (long)len / k * (long)x;
                    item += (long)len % k * (long)y;
                } else {
                    item += (long)len * (long)y;
                }
            }
            res += item;
            prev = b[j];
            i = ni + 1;
            j += 1;
            if (LOCAL) {
                out.println(i + " " + j + " " + item + " " + res);
            }
        }
        if (!flag) out.println(-1);
        else out.println(res);
    }
}


import java.util.*;
import java.util.stream.*;
import java.io.*;
import java.math.*;

public class Main {

    static boolean FROM_FILE = false;

    static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            if (FROM_FILE) {
                try {
                    br = new BufferedReader(new FileReader("input.txt"));
                } catch (IOException error) {
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static int max(int... nums) {
        int res = Integer.MIN_VALUE;
        for (int num: nums) res = Math.max(res, num);
        return res;
    }
    static int min(int... nums) {
        int res = Integer.MAX_VALUE;
        for (int num: nums) res = Math.min(res, num);
        return res;
    }
    static long max(long... nums) {
        long res = Long.MIN_VALUE;
        for (long num: nums) res = Math.max(res, num);
        return res;
    }
    static long min(long... nums) {
        long res = Long.MAX_VALUE;
        for (long num: nums) res = Math.min(res, num);
        return res;
    }

    static FastReader fr = new FastReader();
    static PrintWriter out;

    public static void main(String[] args) {
        if (FROM_FILE) {
            try {
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException error) {

            }
        } else {
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        new Main().run();
        out.flush();
        out.close();
    }

    void run() {
        int n = fr.nextInt(), m = fr.nextInt();
        n += 1; m += 1;
        int x = fr.nextInt(), k = fr.nextInt(), y = fr.nextInt();
        boolean xPrior = (long)x < (long)y * (long)k;
        if (LOCAL) {
            out.println((long)x + " " + ((long)y * (long)k) + " " + xPrior);
        }
        int[] a = new int[n], b = new int[m];
        for (int i = 0; i < n - 1; i += 1) a[i] = fr.nextInt();
        for (int i = 0; i < m - 1; i += 1) b[i] = fr.nextInt();
        a[n - 1] = b[m - 1] = (1 << 30) + (1 << 29);
        int i = 0, j = 0, prev = -1;
        long res = 0;
        boolean flag = true;
        if (LOCAL) {
            out.println(Arrays.toString(a));
            out.println(Arrays.toString(b));
        }
        while (j < m) {
            List<Integer> bigger = new ArrayList<>();
            int ni = i;
            while (ni < n && a[ni] != b[j]) {
                ni += 1;
            }
            if (ni >= n) { flag = false; break; }
            int threshold = max(prev, j < m - 1 ? b[j] : -1);
            for (int p = i; p < ni; p += 1) {
                if (a[p] > threshold) bigger.add(p);
            }
            int len = ni - i;
            if (LOCAL) {
                out.println(i + " " + ni + " " + len + " " + bigger);
            }
            long item = 0L;
            if (bigger.size() > 0) {
                if (len < k) { flag = false; break; }
                int min_t;
                int rangeCnt = bigger.get(bigger.size() - 1) - bigger.get(0) + 1;
                if (rangeCnt % k == 0) min_t = rangeCnt / k;
                else min_t = rangeCnt / k + 1;
                if (min_t * k > len) { flag = false; break; }
                item += min_t * (long)x;
                int remain = len - min_t * k;
                if (xPrior) {
                    item += (long)remain / k * (long)x;
                    item += (long)remain % k * (long)y;
                } else {
                    item += (long)remain * (long)y;
                }
            } else {
                if (xPrior) {
                    item += (long)len / k * (long)x;
                    item += (long)len % k * (long)y;
                } else {
                    item += (long)len * (long)y;
                }
            }
            res += item;
            prev = b[j];
            i = ni + 1;
            j += 1;
            if (LOCAL) {
                out.println(i + " " + j + " " + item + " " + res);
            }
        }
        if (!flag) out.println(-1);
        else out.println(res);
    }
}


import java.util.*;
import java.util.stream.*;
import java.io.*;
import java.math.*;

public class Main {

    static boolean FROM_FILE = false;

    static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            if (FROM_FILE) {
                try {
                    br = new BufferedReader(new FileReader("input.txt"));
                } catch (IOException error) {
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static int max(int... nums) {
        int res = Integer.MIN_VALUE;
        for (int num: nums) res = Math.max(res, num);
        return res;
    }
    static int min(int... nums) {
        int res = Integer.MAX_VALUE;
        for (int num: nums) res = Math.min(res, num);
        return res;
    }
    static long max(long... nums) {
        long res = Long.MIN_VALUE;
        for (long num: nums) res = Math.max(res, num);
        return res;
    }
    static long min(long... nums) {
        long res = Long.MAX_VALUE;
        for (long num: nums) res = Math.min(res, num);
        return res;
    }

    static FastReader fr = new FastReader();
    static PrintWriter out;

    public static void main(String[] args) {
        if (FROM_FILE) {
            try {
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException error) {

            }
        } else {
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        new Main().run();
        out.flush();
        out.close();
    }

    void run() {
        int n = fr.nextInt(), m = fr.nextInt();
        n += 1; m += 1;
        int x = fr.nextInt(), k = fr.nextInt(), y = fr.nextInt();
        boolean xPrior = (long)x < (long)y * (long)k;
        if (LOCAL) {
            out.println((long)x + " " + ((long)y * (long)k) + " " + xPrior);
        }
        int[] a = new int[n], b = new int[m];
        for (int i = 0; i < n - 1; i += 1) a[i] = fr.nextInt();
        for (int i = 0; i < m - 1; i += 1) b[i] = fr.nextInt();
        a[n - 1] = b[m - 1] = (1 << 30) + (1 << 29);
        int i = 0, j = 0, prev = -1;
        long res = 0;
        boolean flag = true;
        if (LOCAL) {
            out.println(Arrays.toString(a));
            out.println(Arrays.toString(b));
        }
        while (j < m) {
            List<Integer> bigger = new ArrayList<>();
            int ni = i;
            while (ni < n && a[ni] != b[j]) {
                ni += 1;
            }
            if (ni >= n) { flag = false; break; }
            int threshold = max(prev, j < m ? b[j] : -1);
            for (int p = i; p < ni; p += 1) {
                if (a[p] > threshold) bigger.add(p);
            }
            int len = ni - i;
            if (LOCAL) {
                out.println(i + " " + ni + " " + len + " " + bigger);
            }
            long item = 0L;
            if (bigger.size() > 0) {
                if (len < k) { flag = false; break; }
                int min_t;
                int rangeCnt = bigger.get(bigger.size() - 1) - bigger.get(0) + 1;
                if (rangeCnt % k == 0) min_t = rangeCnt / k;
                else min_t = rangeCnt / k + 1;
                if (min_t * k > len) { flag = false; break; }
                item += min_t * (long)x;
                int remain = len - min_t * k;
                if (xPrior) {
                    item += (long)remain / k * (long)x;
                    item += (long)remain % k * (long)y;
                } else {
                    item += (long)remain * (long)y;
                }
            } else {
                if (xPrior) {
                    item += (long)len / k * (long)x;
                    item += (long)len % k * (long)y;
                } else {
                    item += (long)len * (long)y;
                }
            }
            res += item;
            prev = b[j];
            i = ni + 1;
            j += 1;
            if (LOCAL) {
                out.println(i + " " + j + " " + item + " " + res);
            }
        }
        if (!flag) out.println(-1);
        else out.println(res);
    }
}


import java.util.*;
import java.util.stream.*;
import java.io.*;
import java.math.*;

public class Main {

    static boolean FROM_FILE = false;

    static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            if (FROM_FILE) {
                try {
                    br = new BufferedReader(new FileReader("input.txt"));
                } catch (IOException error) {
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static int max(int... nums) {
        int res = Integer.MIN_VALUE;
        for (int num: nums) res = Math.max(res, num);
        return res;
    }
    static int min(int... nums) {
        int res = Integer.MAX_VALUE;
        for (int num: nums) res = Math.min(res, num);
        return res;
    }
    static long max(long... nums) {
        long res = Long.MIN_VALUE;
        for (long num: nums) res = Math.max(res, num);
        return res;
    }
    static long min(long... nums) {
        long res = Long.MAX_VALUE;
        for (long num: nums) res = Math.min(res, num);
        return res;
    }

    static FastReader fr = new FastReader();
    static PrintWriter out;

    public static void main(String[] args) {
        if (FROM_FILE) {
            try {
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException error) {

            }
        } else {
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        new Main().run();
        out.flush();
        out.close();
    }

    void run() {
        int n = fr.nextInt(), m = fr.nextInt();
        n += 1; m += 1;
        int x = fr.nextInt(), k = fr.nextInt(), y = fr.nextInt();
        boolean xPrior = (long)x < (long)y * k;
        int[] a = new int[n], b = new int[m];
        for (int i = 0; i < n - 1; i += 1) a[i] = fr.nextInt();
        for (int i = 0; i < m - 1; i += 1) b[i] = fr.nextInt();
        a[n - 1] = b[m - 1] = 1 << 30;
        int i = 0, j = 0, prev = -1;
        long res = 0;
        boolean flag = true;
        if (LOCAL) {
            out.println(Arrays.toString(a));
            out.println(Arrays.toString(b));
        }
        while (j < m) {
            List<Integer> bigger = new ArrayList<>();
            int ni = i;
            while (ni < n && a[ni] != b[j]) {
                ni += 1;
            }
            if (ni >= n) { flag = false; break; }
            int threshold = max(prev, b[j]);
            for (int p = i; p < ni; p += 1) {
                if (a[p] > threshold) bigger.add(p);
            }
            int len = ni - i;
            if (LOCAL) out.println(i + " " + ni + " " + len + " " + bigger);
            long item = 0L;
            if (bigger.size() > 0) {
                if (len < k) { flag = false; break; }
                int min_t = 0;
                if (bigger.size() == 1) min_t = 1;
                else {
                    int diff = (bigger.get(bigger.size() - 1) - bigger.get(0) + 1);
                    if (diff % k == 0) min_t = diff / k;
                    else min_t = diff / k + 1;
                }
                if (min_t * k > len) { flag = false; break; }
                item += min_t * (long)x;
                int remain = len - min_t * k;
                if (xPrior) {
                    item += remain / k * (long)x;
                    item += remain % k * (long)y;
                } else {
                    item += remain * (long)y;
                }
            } else {
                if (xPrior) {
                    item += len / k * (long)x;
                    item += len % k * (long)y;
                } else {
                    item += len * (long)y;
                }
            }
            res += item;
            prev = b[j];
            i = ni + 1;
            j += 1;
            if (LOCAL) out.println(i + " " + j + " " + item + " " + res);
        }
        if (!flag) out.println(-1);
        else out.println(res);
    }
}


import java.util.*;
import java.util.stream.*;
import java.io.*;
import java.math.*;

public class Main {

    static boolean FROM_FILE = false;

    static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            if (FROM_FILE) {
                try {
                    br = new BufferedReader(new FileReader("input.txt"));
                } catch (IOException error) {
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static int max(int... nums) {
        int res = Integer.MIN_VALUE;
        for (int num: nums) res = Math.max(res, num);
        return res;
    }
    static int min(int... nums) {
        int res = Integer.MAX_VALUE;
        for (int num: nums) res = Math.min(res, num);
        return res;
    }
    static long max(long... nums) {
        long res = Long.MIN_VALUE;
        for (long num: nums) res = Math.max(res, num);
        return res;
    }
    static long min(long... nums) {
        long res = Long.MAX_VALUE;
        for (long num: nums) res = Math.min(res, num);
        return res;
    }

    static FastReader fr = new FastReader();
    static PrintWriter out;

    public static void main(String[] args) {
        if (FROM_FILE) {
            try {
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException error) {

            }
        } else {
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        new Main().run();
        out.flush();
        out.close();
    }

    void run() {
        int n = fr.nextInt(), m = fr.nextInt();
        n += 1; m += 1;
        int x = fr.nextInt(), k = fr.nextInt(), y = fr.nextInt();
        boolean xPrior = (long)x < (long)y * k;
        int[] a = new int[n], b = new int[m];
        for (int i = 0; i < n - 1; i += 1) a[i] = fr.nextInt();
        for (int i = 0; i < m - 1; i += 1) b[i] = fr.nextInt();
        a[n - 1] = b[m - 1] = 1 << 30;
        int i = 0, j = 0, prev = -1, res = 0;
        boolean flag = true;
        while (j < m) {
            List<Integer> bigger = new ArrayList<>();
            int ni = i;
            while (ni < n && a[ni] != b[j]) {
                if (a[ni] > b[j]) bigger.add(ni);
                ni += 1;
            }
            if (ni >= n) { flag = false; break; }
            int threshold = max(prev, b[j]);
            for (int p = i; p < ni; p += 1) {
                if (a[p] > threshold) bigger.add(p);
            }
            out.println(i + " " + ni + " " + bigger);
            int len = ni - i;
            long item = 0L;
            if (bigger.size() > 0) {
                if (len < k) { flag = false; break; }
                int cur = bigger.get(0), remain = cur - i - 1, p = 1;
                while (p < bigger.size()) {
                    while (p < bigger.size() && bigger.get(p) <= cur + k - 1) p += 1;
                    if (p < bigger.size()) {
                        remain += bigger.get(p) - (cur + k);
                        cur = bigger.get(p);
                        item += x;
                        p += 1;
                    }
                }
                remain += ni - 1 - cur;
                if (remain < k - 1) { flag = false; break; }
                remain -= k; item += y;
                if (xPrior) {
                    item += remain / k * (long)x;
                    item += remain % k * (long)y;
                } else {
                    item += remain * (long)y;
                }
            } else {
                if (xPrior) {
                    item += len / k * (long)x;
                    item += len % k * (long)y;
                } else {
                    item += len * (long)y;
                }
            }
            res += item;
            prev = b[j];
            i = ni + 1;
            j += 1;
            // out.println(i + " " + j);
        }
        if (!flag) out.println(-1);
        else out.println(res);
    }
}


import java.util.*;
import java.util.stream.*;
import java.io.*;
import java.math.*;

public class Main {

    static boolean FROM_FILE = false;

    static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            if (FROM_FILE) {
                try {
                    br = new BufferedReader(new FileReader("input.txt"));
                } catch (IOException error) {
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static int max(int... nums) {
        int res = Integer.MIN_VALUE;
        for (int num: nums) res = Math.max(res, num);
        return res;
    }
    static int min(int... nums) {
        int res = Integer.MAX_VALUE;
        for (int num: nums) res = Math.min(res, num);
        return res;
    }
    static long max(long... nums) {
        long res = Long.MIN_VALUE;
        for (long num: nums) res = Math.max(res, num);
        return res;
    }
    static long min(long... nums) {
        long res = Long.MAX_VALUE;
        for (long num: nums) res = Math.min(res, num);
        return res;
    }

    static FastReader fr = new FastReader();
    static PrintWriter out;

    public static void main(String[] args) {
        if (FROM_FILE) {
            try {
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException error) {

            }
        } else {
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        new Main().run();
        out.flush();
        out.close();
    }

    void run() {
        int n = fr.nextInt(), m = fr.nextInt();
        n += 1; m += 1;
        int x = fr.nextInt(), k = fr.nextInt(), y = fr.nextInt();
        boolean xPrior = (long)x < (long)y * k;
        int[] a = new int[n], b = new int[m];
        for (int i = 0; i < n - 1; i += 1) a[i] = fr.nextInt();
        for (int i = 0; i < m - 1; i += 1) b[i] = fr.nextInt();
        a[n - 1] = b[m - 1] = 1 << 30;
        int i = 0, j = 0, prev = -1, res = 0;
        boolean flag = true;
        if (LOCAL) {
            out.println(Arrays.toString(a));
            out.println(Arrays.toString(b));
        }
        while (j < m) {
            List<Integer> bigger = new ArrayList<>();
            int ni = i;
            while (ni < n && a[ni] != b[j]) {
                ni += 1;
            }
            if (ni >= n) { flag = false; break; }
            int threshold = max(prev, b[j]);
            for (int p = i; p < ni; p += 1) {
                if (a[p] > threshold) bigger.add(p);
            }
            int len = ni - i;
            if (LOCAL) out.println(i + " " + ni + " " + len + " " + bigger);
            long item = 0L;
            if (bigger.size() > 0) {
                if (len < k) { flag = false; break; }
                int min_t = 0;
                if (bigger.size() == 1) min_t = 1;
                else {
                    int diff = (bigger.get(bigger.size() - 1) - bigger.get(0) + 1);
                    if (diff % k == 0) min_t = diff / k;
                    else min_t = diff / k + 1;
                }
                if (min_t * k > len) { flag = false; break; }
                item += min_t * (long)x;
                int remain = len - min_t * k;
                if (xPrior) {
                    item += remain / k * (long)x;
                    item += remain % k * (long)y;
                } else {
                    item += remain * (long)y;
                }
            } else {
                if (xPrior) {
                    item += len / k * (long)x;
                    item += len % k * (long)y;
                } else {
                    item += len * (long)y;
                }
            }
            res += item;
            prev = b[j];
            i = ni + 1;
            j += 1;
            if (LOCAL) out.println(i + " " + j + " " + item + " " + res);
        }
        if (!flag) out.println(-1);
        else out.println(res);
    }
}


import java.util.*;
import java.util.stream.*;
import java.io.*;
import java.math.*;

public class Main {

    static boolean FROM_FILE = false;

    static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            if (FROM_FILE) {
                try {
                    br = new BufferedReader(new FileReader("input.txt"));
                } catch (IOException error) {
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static int max(int... nums) {
        int res = Integer.MIN_VALUE;
        for (int num: nums) res = Math.max(res, num);
        return res;
    }
    static int min(int... nums) {
        int res = Integer.MAX_VALUE;
        for (int num: nums) res = Math.min(res, num);
        return res;
    }
    static long max(long... nums) {
        long res = Long.MIN_VALUE;
        for (long num: nums) res = Math.max(res, num);
        return res;
    }
    static long min(long... nums) {
        long res = Long.MAX_VALUE;
        for (long num: nums) res = Math.min(res, num);
        return res;
    }

    static FastReader fr = new FastReader();
    static PrintWriter out;

    public static void main(String[] args) {
        if (FROM_FILE) {
            try {
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException error) {

            }
        } else {
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        new Main().run();
        out.flush();
        out.close();
    }

    void run() {
        int n = fr.nextInt(), m = fr.nextInt();
        n += 1; m += 1;
        int x = fr.nextInt(), k = fr.nextInt(), y = fr.nextInt();
        boolean xPrior = (long)x < (long)y * k;
        int[] a = new int[n], b = new int[m];
        for (int i = 0; i < n - 1; i += 1) a[i] = fr.nextInt();
        for (int i = 0; i < m - 1; i += 1) b[i] = fr.nextInt();
        a[n - 1] = b[m - 1] = 1 << 30;
        int i = 0, j = 0, prev = -1, res = 0;
        boolean flag = true;
        while (j < m) {
            List<Integer> bigger = new ArrayList<>();
            int ni = i;
            while (ni < n && a[ni] != b[j]) {
                if (a[ni] > b[j]) bigger.add(ni);
                ni += 1;
            }
            if (ni >= n) { flag = false; break; }
            int threshold = max(prev, b[j]);
            for (int p = i; p < ni; p += 1) {
                if (a[p] > threshold) bigger.add(p);
            }
            // out.println(i + " " + ni + " " + bigger);
            int len = ni - i;
            long item = 0L;
            if (bigger.size() > 0) {
                if (len < k) { flag = false; break; }
                int cur = bigger.get(0), remain = cur - i - 1, p = 1;
                while (p < bigger.size()) {
                    while (p < bigger.size() && bigger.get(p) <= cur + k - 1) p += 1;
                    if (p < bigger.size()) {
                        remain += bigger.get(p) - (cur + k);
                        cur = bigger.get(p);
                        item += x;
                        p += 1;
                    }
                }
                remain += ni - 1 - cur;
                if (remain < k - 1) { flag = false; break; }
                remain -= k; item += y;
                if (xPrior) {
                    item += remain / k * (long)x;
                    item += remain % k * (long)y;
                } else {
                    item += remain * (long)y;
                }
            } else {
                if (xPrior) {
                    item += len / k * (long)x;
                    item += len % k * (long)y;
                } else {
                    item += len * (long)y;
                }
            }
            res += item;
            prev = b[j];
            i = ni + 1;
            j += 1;
            // out.println(i + " " + j);
        }
        if (!flag) out.println(-1);
        else out.println(res);
    }
}


import java.util.*;
import java.util.stream.*;
import java.io.*;
import java.math.*;

public class Main {

    static boolean FROM_FILE = false;

    static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            if (FROM_FILE) {
                try {
                    br = new BufferedReader(new FileReader("input.txt"));
                } catch (IOException error) {
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static int max(int... nums) {
        int res = Integer.MIN_VALUE;
        for (int num: nums) res = Math.max(res, num);
        return res;
    }
    static int min(int... nums) {
        int res = Integer.MAX_VALUE;
        for (int num: nums) res = Math.min(res, num);
        return res;
    }
    static long max(long... nums) {
        long res = Long.MIN_VALUE;
        for (long num: nums) res = Math.max(res, num);
        return res;
    }
    static long min(long... nums) {
        long res = Long.MAX_VALUE;
        for (long num: nums) res = Math.min(res, num);
        return res;
    }

    static FastReader fr = new FastReader();
    static PrintWriter out;

    public static void main(String[] args) {
        if (FROM_FILE) {
            try {
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException error) {

            }
        } else {
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        new Main().run();
        out.flush();
        out.close();
    }

    void run() {
        int n = fr.nextInt(), m = fr.nextInt();
        n += 1; m += 1;
        int x = fr.nextInt(), k = fr.nextInt(), y = fr.nextInt();
        boolean xPrior = (long)x < (long)y * (long)k;
        if (LOCAL) {
            out.println((long)x + " " + ((long)y * (long)k) + " " + xPrior);
        }
        int[] a = new int[n], b = new int[m];
        for (int i = 0; i < n - 1; i += 1) a[i] = fr.nextInt();
        for (int i = 0; i < m - 1; i += 1) b[i] = fr.nextInt();
        a[n - 1] = b[m - 1] = (1 << 30) + (1 << 29);
        int i = 0, j = 0, prev = -1;
        long res = 0;
        boolean flag = true;
        if (LOCAL) {
            out.println(Arrays.toString(a));
            out.println(Arrays.toString(b));
        }
        while (j < m) {
            List<Integer> bigger = new ArrayList<>();
            int ni = i;
            while (ni < n && a[ni] != b[j]) {
                ni += 1;
            }
            if (ni >= n) { flag = false; break; }
            int threshold = max(prev, b[j]);
            for (int p = i; p < ni; p += 1) {
                if (a[p] > threshold) bigger.add(p);
            }
            int len = ni - i;
            if (LOCAL) {
                out.println(i + " " + ni + " " + len + " " + bigger);
            }
            long item = 0L;
            if (bigger.size() > 0) {
                if (len < k) { flag = false; break; }
                int min_t = 0, p = 0;
                do {
                    min_t += 1;
                    int q = p + 1;
                    while (q < bigger.size() && bigger.get(q) - bigger.get(p) < k) q += 1;
                    p = q;
                } while (p < bigger.size());
                if (min_t * k > len) { flag = false; break; }
                item += min_t * (long)x;
                int remain = len - min_t * k;
                if (xPrior) {
                    item += remain / k * (long)x;
                    item += remain % k * (long)y;
                } else {
                    item += remain * (long)y;
                }
            } else {
                if (xPrior) {
                    item += len / k * (long)x;
                    item += len % k * (long)y;
                } else {
                    item += len * (long)y;
                }
            }
            res += item;
            prev = b[j];
            i = ni + 1;
            j += 1;
            if (LOCAL) {
                out.println(i + " " + j + " " + item + " " + res);
            }
        }
        if (!flag) out.println(-1);
        else out.println(res);
    }
}


import java.util.*;
// scanner.nextInt();
public class Solution {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

            int n = scanner.nextInt();
            int m = scanner.nextInt();
            long fire = scanner.nextLong();
            int range = scanner.nextInt();
            long ber = scanner.nextLong();

            int[] first = new int[n];
                for(int i = 0; i < n; ++i)
                    {
                        first[i] = scanner.nextInt();
                    }
            int[] second = new int[m];
                for(int i = 0; i < m; ++i)
                       {
                           second[i] = scanner.nextInt();
                       }

                if(n < m) System.out.println("-1");
                else if(n == m)
                {
                    boolean pos = true;
                    for(int i = 0; i < m; ++i)
                       {
                           if(!(first[i] == second[i]))
                           {
                               pos = false;
                               break;
                           }
                       }
                    int res = pos ? 0 : -1;
                    System.out.println(res);
                }
                else
                {
                    boolean pos = true;
                    ArrayList<Integer> list = new ArrayList<>();

                    int index = 0;
                    for(int i = 0; i < m; ++i)
                    {
                        for(; index <= n; ++index)
                        {
                            if(index == n)
                            {
                                pos = false;
                                break;
                            }
                            else if(second[i] == first[index])
                            {
                                list.add(i);
                                break;
                            }
                        }
                    }

                    if(!pos) System.out.println("-1");
                    else
                    {
                        long res = 0;
                        int left = -1;
                        int right = -1;
                        list.add(0, -1);
                        list.add(-1);
                        for(int i = 0; i < list.size()-1; ++i)
                        {
                           left = list.get(i);
                           right = list.get(i+1);
                           // calcular el numero de numeros entre los dos
                           int j = left == -1 ? 0 : left+1;
                           int siz = right == -1 ? n : right;

                           int max = Integer.MIN_VALUE;
                           int contador = 0;
                           for(;j < siz; ++j)
                           {
                               if(first[j] > max) max = first[j];
                               ++contador;
                           }

                           if(contador % range != 0)
                           {
                               res += (contador%range)*ber;
                               contador -= contador%range;
                           }

                           if(fire <= ber*range)
                           {
                               res += fire*(contador/range);
                           }
                           else
                           {
                               if(Math.max(left, right) > max)
                               {
                                   res += ber*contador;
                               }
                               else
                               {
                                   res += ber*(contador-range);
                                   res += fire;
                               }
                           }
                        }
                        System.out.println(res);
                    }
                }

                //crear arreglo donde hago connect
                // el primero lo recibo normal
                // el segundo reciob el int, y busco el indice, si no lo encuentgra erntonces -1
                //suponiendo que recibi todos los indices, me voy moviendo por cada uno de los de -1, empezando con left = -1 y right hasta que no esa -1
                // cuando termina ahce left = right y right lo que esa... y empeiza a buscar el -1...

    }
}


import java.util.*;
// scanner.nextInt();
public class Solution {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

            int n = scanner.nextInt();
            int m = scanner.nextInt();
            long fire = scanner.nextLong();
            int range = scanner.nextInt();
            long ber = scanner.nextLong();

            int[] first = new int[n];
                for(int i = 0; i < n; ++i)
                    {
                        first[i] = scanner.nextInt();
                    }
            int[] second = new int[m];
                for(int i = 0; i < m; ++i)
                       {
                           second[i] = scanner.nextInt();
                       }

                if(n < m) System.out.println("-1");
                else if(n == m)
                {
                    boolean pos = true;
                    for(int i = 0; i < m; ++i)
                       {
                           if(!(first[i] == second[i]))
                           {
                               pos = false;
                               break;
                           }
                       }
                    int res = pos ? 0 : -1;
                    System.out.println(res);
                }
                else
                {
                    boolean pos = true;
                    ArrayList<Integer> list = new ArrayList<>();

                    int index = 0;
                    for(int i = 0; i < m; ++i)
                    {
                        for(; index <= n; ++index)
                        {
                            if(index == n)
                            {
                                pos = false;
                                break;
                            }
                            else if(second[i] == first[index])
                            {
                                list.add(index);
                                break;
                            }
                        }
                    }

                    if(!pos) System.out.println("-1");
                    else
                    {
                        long res = 0;
                        int left = -1;
                        int right = -1;
                        list.add(0, -1);
                        list.add(-1);
                        for(int i = 0; i < list.size()-1; ++i)
                        {
                           left = list.get(i);
                           right = list.get(i+1);
                           // calcular el numero de numeros entre los dos
                           int j = left == -1 ? 0 : left+1;
                           int siz = right == -1 ? n : right;

                           int max = Integer.MIN_VALUE;
                           int contador = 0;
                           for(;j < siz; ++j)
                           {
                               if(first[j] > max) max = first[j];
                               ++contador;
                           }
                           if(left != -1) left = first[left];
                           if(right != -1) right = first[right];

                           if(contador % range != 0)
                           {
                               if(contador >= range)
                               {
                                  res += (contador%range)*ber;
                                  contador -= contador%range;
                               }
                               else
                               {
                                   if(Math.max(left, right) > max)
                                   {
                                       res += contador*ber;
                                       continue;
                                   }
                                   else
                                   {
                                       res = -1;
                                       break;
                                   }
                               }

                           }

                           if(fire <= ber*range)
                           {
                               res += fire*(contador/range);
                           }
                           else
                           {
                               if(Math.max(left, right) > max)
                               {
                                   res += ber*contador;
                               }
                               else
                               {
                                   res += ber*(contador-range);
                                   res += fire;
                               }
                           }
                        }
                        System.out.println(res);
                    }
                }

                //crear arreglo donde hago connect
                // el primero lo recibo normal
                // el segundo reciob el int, y busco el indice, si no lo encuentgra erntonces -1
                //suponiendo que recibi todos los indices, me voy moviendo por cada uno de los de -1, empezando con left = -1 y right hasta que no esa -1
                // cuando termina ahce left = right y right lo que esa... y empeiza a buscar el -1...

    }
}


import java.util.*;
// scanner.nextInt();
public class Solution {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

            int n = scanner.nextInt();
            int m = scanner.nextInt();
            long fire = scanner.nextLong();
            int range = scanner.nextInt();
            long ber = scanner.nextLong();

            int[] first = new int[n];
                for(int i = 0; i < n; ++i)
                    {
                        first[i] = scanner.nextInt();
                    }
            int[] second = new int[m];
                for(int i = 0; i < m; ++i)
                       {
                           second[i] = scanner.nextInt();
                       }

                if(n < m) System.out.println("-1");
                else if(n == m)
                {
                    boolean pos = true;
                    for(int i = 0; i < m; ++i)
                       {
                           if(!(first[i] == second[i]))
                           {
                               pos = false;
                               break;
                           }
                       }
                    int res = pos ? 0 : -1;
                    System.out.println(res);
                }
                else
                {
                    boolean pos = true;
                    ArrayList<Integer> list = new ArrayList<>();

                    int index = 0;
                    for(int i = 0; i < m; ++i)
                    {
                        for(; index <= n; ++index)
                        {
                            if(index == n)
                            {
                                pos = false;
                                break;
                            }
                            else if(second[i] == first[index])
                            {
                                list.add(index);
                                break;
                            }
                        }
                    }

                    if(!pos) System.out.println("-1");
                    else
                    {
                        long res = 0;
                        int left = -1;
                        int right = -1;
                        list.add(0, -1);
                        list.add(-1);
                        for(int i = 0; i < list.size()-1; ++i)
                        {
                           left = list.get(i);
                           right = list.get(i+1);
                           // calcular el numero de numeros entre los dos
                           int j = left == -1 ? 0 : left+1;
                           int siz = right == -1 ? n : right;

                           int max = Integer.MIN_VALUE;
                           int contador = 0;
                           for(;j < siz; ++j)
                           {
                               if(first[j] > max) max = first[j];
                               ++contador;
                           }
                           if(left != -1) left = first[left];
                           if(right != -1) right = first[right];

                           if(contador % range != 0)
                           {
                               res += (contador%range)*ber;
                               contador -= contador%range;
                           }

                           if(fire <= ber*range)
                           {
                               res += fire*(contador/range);
                           }
                           else
                           {
                               if(Math.max(left, right) > max)
                               {
                                   res += ber*contador;
                               }
                               else
                               {
                                   res += ber*(contador-range);
                                   res += fire;
                               }
                           }
                        }
                        System.out.println(res);
                    }
                }

                //crear arreglo donde hago connect
                // el primero lo recibo normal
                // el segundo reciob el int, y busco el indice, si no lo encuentgra erntonces -1
                //suponiendo que recibi todos los indices, me voy moviendo por cada uno de los de -1, empezando con left = -1 y right hasta que no esa -1
                // cuando termina ahce left = right y right lo que esa... y empeiza a buscar el -1...

    }
}


import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import java.io.*;

public class QQ4 {
	static int x = 0;
	static int k = 0;
	static int y = 0;
	static int ans = 0;
	static int[] main;

	public static void main(String[] args) throws NumberFormatException, IOException, InterruptedException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		int m = sc.nextInt();
		x = sc.nextInt();
		k = sc.nextInt();
		y = sc.nextInt();
		main = sc.nextIntArr(n);
		int[] sub = sc.nextIntArr(m);
		int j = 0;
		boolean[] mirmain = new boolean[n];
		for (int i = 0; i < main.length; i++) {
			if (j == sub.length)
				break;
			if (main[i] == sub[j]) {
				mirmain[i] = true;
				j++;
			}
		}
		if (j != sub.length) {
			System.out.println(-1);
			return;
		}
	//	System.out.println(Arrays.toString(mirmain));
		int max = 0;
		int start = 0;
		boolean count = false;
		for (int i = 0; i < mirmain.length; i++) {
			if (mirmain[i]) {
				if (count) {
					solve(start, i - 1, Math.max(max, main[i]));
					if (ans == -1) {
						System.out.println(-1);
						return;
					}
				}
				max = main[i];
				count = false;
			} else {
				if (!count) {
					count = true;
					start = i;
				}
			}
		}
		if (mirmain[mirmain.length - 1] == false) {
			solve(start, mirmain.length - 1, max);
			if (ans == -1) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans);
		pw.close();
	}

	private static void solve(int start, int end, int max) {
		boolean useone = false;
		if (x / k >= y)
			useone = true;
		int len = end - start + 1;
		if (len < k) {
			int inmax = 0;
			for (int i = start; i < end + 1; i++) {
				if (main[i] > inmax)
					inmax = main[i];
			}
			if (max < inmax) {
				ans = -1;
			} else {
				ans += len * y;
			}
		} else {
			if (useone) {
				int inmax = 0;
				for (int i = start; i < end + 1; i++) {
					if (main[i] > inmax)
						inmax = main[i];
				}
				if (max < inmax) {
					ans += x + (len - k) * y;
				} else {
					ans += len * y;
				}
			} else {
				ans += (len / k) * x + (len % k) * y;
			}
		}

	}

	static void shuffleArray(int[] ar) {
		// If running on Java 6 or older, use `new Random()` on RHS here
		Random rnd = ThreadLocalRandom.current();
		for (int i = ar.length - 1; i > 0; i--) {
			int index = rnd.nextInt(i + 1);
			// Simple swap
			int a = ar[index];
			ar[index] = ar[i];
			ar[i] = a;
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader r) {
			br = new BufferedReader(r);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < arr.length; i++)
				arr[i] = nextInt();
			return arr;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}


import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import java.io.*;

public class QQ4 {
	static int x = 0;
	static int k = 0;
	static int y = 0;
	static long ans = 0;
	static int[] main;

	public static void main(String[] args) throws NumberFormatException, IOException, InterruptedException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		int m = sc.nextInt();
		x = sc.nextInt();
		k = sc.nextInt();
		y = sc.nextInt();
		main = sc.nextIntArr(n);
		int[] sub = sc.nextIntArr(m);
		int j = 0;
		boolean[] mirmain = new boolean[n];
		for (int i = 0; i < main.length; i++) {
			if (j == sub.length)
				break;
			if (main[i] == sub[j]) {
				mirmain[i] = true;
				j++;
			}
		}
		if (j != sub.length) {
			System.out.println(-1);
			return;
		}
	//	System.out.println(Arrays.toString(mirmain));
		int max = 0;
		int start = 0;
		boolean count = false;
		for (int i = 0; i < mirmain.length; i++) {
			if (mirmain[i]) {
				if (count) {
					solve(start, i - 1, Math.max(max, main[i]));
					if (ans == -1) {
						System.out.println(-1);
						return;
					}
				}
				max = main[i];
				count = false;
			} else {
				if (!count) {
					count = true;
					start = i;
				}
			}
		}
		if (mirmain[mirmain.length - 1] == false) {
			solve(start, mirmain.length - 1, max);
			if (ans == -1) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans);
		pw.close();
	}

	private static void solve(int start, int end, int max) {
		boolean useone = false;
		if (x / k >= y)
			useone = true;
		int len = end - start + 1;
		if (len < k) {
			int inmax = 0;
			for (int i = start; i < end + 1; i++) {
				if (main[i] > inmax)
					inmax = main[i];
			}
			if (max < inmax) {
				ans = -1;
			} else {
				ans += 1l*len * y;
			}
		} else {
			if (useone) {
				int inmax = 0;
				for (int i = start; i < end + 1; i++) {
					if (main[i] > inmax)
						inmax = main[i];
				}
				if (max < inmax) {
					ans += x + 1l*(len - k) * y;
				} else {
					ans += 1l*len * y;
				}
			} else {
				ans += 1l*(len / k) * x + 1l*(len % k) * y;
			}
		}

	}

	static void shuffleArray(int[] ar) {
		// If running on Java 6 or older, use `new Random()` on RHS here
		Random rnd = ThreadLocalRandom.current();
		for (int i = ar.length - 1; i > 0; i--) {
			int index = rnd.nextInt(i + 1);
			// Simple swap
			int a = ar[index];
			ar[index] = ar[i];
			ar[i] = a;
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader r) {
			br = new BufferedReader(r);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < arr.length; i++)
				arr[i] = nextInt();
			return arr;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}


import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import java.io.*;

public class QQ4 {
	static int x = 0;
	static int k = 0;
	static int y = 0;
	static int ans = 0;
	static int[] main;

	public static void main(String[] args) throws NumberFormatException, IOException, InterruptedException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		int m = sc.nextInt();
		x = sc.nextInt();
		k = sc.nextInt();
		y = sc.nextInt();
		main = sc.nextIntArr(n);
		int[] sub = sc.nextIntArr(m);
		int j = 0;
		boolean[] mirmain = new boolean[n];
		for (int i = 0; i < main.length; i++) {
			if (j == sub.length)
				break;
			if (main[i] == sub[j]) {
				mirmain[i] = true;
				j++;
			}
		}
		if (j != sub.length) {
			System.out.println(-1);
			return;
		}
	//	System.out.println(Arrays.toString(mirmain));
		int max = 0;
		int start = 0;
		boolean count = false;
		for (int i = 0; i < mirmain.length; i++) {
			if (mirmain[i]) {
				if (count) {
					solve(start, i - 1, Math.max(max, main[i]));
					if (ans == -1) {
						System.out.println(-1);
						return;
					}
				}
				max = main[i];
				count = false;
			} else {
				if (!count) {
					count = true;
					start = i;
				}
			}
		}
		if (mirmain[mirmain.length - 1] == false) {
			solve(start, mirmain.length - 1, max);
			if (ans == -1) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans);
		pw.close();
	}

	private static void solve(int start, int end, int max) {
		boolean useone = false;
		if (x / k >= y)
			useone = true;
		int len = end - start + 1;
		if (len < k) {
			int inmax = 0;
			for (int i = start; i < end + 1; i++) {
				if (main[i] > inmax)
					inmax = main[i];
			}
			if (max < inmax) {
				ans = -1;
			} else {
				ans += len * y;
			}
		} else {
			if (useone) {
				int inmax = 0;
				for (int i = start; i < end + 1; i++) {
					if (main[i] > inmax)
						inmax = main[i];
				}
				if (max < inmax) {
					ans += k * x + (len - k) * y;
				} else {
					ans += len * y;
				}
			} else {
				ans += (len / k) * x + (len % k) * y;
			}
		}

	}

	static void shuffleArray(int[] ar) {
		// If running on Java 6 or older, use `new Random()` on RHS here
		Random rnd = ThreadLocalRandom.current();
		for (int i = ar.length - 1; i > 0; i--) {
			int index = rnd.nextInt(i + 1);
			// Simple swap
			int a = ar[index];
			ar[index] = ar[i];
			ar[i] = a;
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader r) {
			br = new BufferedReader(r);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < arr.length; i++)
				arr[i] = nextInt();
			return arr;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}


import java.io.*;
import java.util.*;

public class Main {

    private static long testCase(int n, int m, int x, int k, int y, int[] a, int[] b) {
        long ans = 0;
        int i = 0, j = 0;
        List<Integer> toBeDestroyed;

        for (j = 0; j < m; j++) {
            toBeDestroyed = new ArrayList<>();

            while (i < n && a[i] != b[j]) toBeDestroyed.add(a[i++]);

            if (i >= n) return -1;

            long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, j == 0 ? -2 : b[j - 1], b[j], x <= y * k);

            if (manaNeeded == -1) return -1;
            else ans += manaNeeded;

            i++;
        }

        toBeDestroyed = new ArrayList<>();

        while (i < n) toBeDestroyed.add(a[i++]);

        long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, b[m - 1], -1, x <= y * k);

        if (manaNeeded == -1) return -1;
        else ans += manaNeeded;

        return ans;

        //debug
        /*for (int a1 : a) {
            System.out.print(a1 + " ");
        }
        System.out.println("END");*/
    }

    private static long manaToDestroy(List<Integer> warriors, int x, int k, int y, int leftWarrior, int rightWarrior, boolean canUseFireball) {
        if (warriors.size() == 0) return 0;

        if (canUseFireball) {
            return x * (warriors.size() / k) + y * (warriors.size() % k);
        } else {
            int max = -1;

            for (int warrior : warriors) {
                max = Math.max(max, warrior);
            }

            if (max > leftWarrior && max > rightWarrior) {
                return -1;
            } else {
                return warriors.size() * y;
            }
        }
    }

    public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
//        int t = in.nextInt();  // Scanner has functions to read ints, longs, strings, chars, etc.
        //in.nextLine();
//        for (int i = 1; i <= t; ++i) {
        int n = in.nextInt(), m = in.nextInt();
        int x = in.nextInt(), k = in.nextInt(), y = in.nextInt();
        int[] a = in.readArray(n), b = in.readArray(m);

        out.println(testCase(n, m, x, k, y, a, b));
//        }

        out.close();
    }

    private static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    private static long testCase(int n, int m, long x, int k, long y, int[] a, int[] b) {
        long ans = 0;
        int i = 0, j = 0;
        List<Integer> toBeDestroyed;

        for (j = 0; j < m; j++) {
            toBeDestroyed = new ArrayList<>();

            while (i < n && a[i] != b[j]) toBeDestroyed.add(a[i++]);

            if (i >= n) return -1;

            long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, j == 0 ? -2 : b[j - 1], b[j]);

            if (manaNeeded == -1) return -1;
            else ans += manaNeeded;

            i++;
        }

        toBeDestroyed = new ArrayList<>();

        while (i < n) toBeDestroyed.add(a[i++]);

        long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, b[m - 1], -2);

        if (manaNeeded == -1) return -1;
        else ans += manaNeeded;

        return ans;
    }

    private static long manaToDestroy(List<Integer> warriors, long x, int k, long y, int leftWarrior, int rightWarrior) {
        long size = warriors.size();
        if (warriors.size() == 0) return 0;

        if (x <= y * k) {
            return x * (size / k) + y * (size % k);
        } else {
            int numStrongerWarriors = 0;

            for (int warrior : warriors) {
                if ((leftWarrior > 0 && warrior > leftWarrior) && (rightWarrior > 0 && warrior > rightWarrior)) numStrongerWarriors++;
            }

            if (numStrongerWarriors > 0) {
                //cannot berserk all the way
                long numFireBalls = (numStrongerWarriors + k - 1) / k;
                return x * numFireBalls + y * (size - (numFireBalls * k));
            } else {
                return size * y;
            }
        }
    }

    public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
//        int t = in.nextInt();  // Scanner has functions to read ints, longs, strings, chars, etc.
        //in.nextLine();
//        for (int i = 1; i <= t; ++i) {
        int n = in.nextInt(), m = in.nextInt();
        long x = in.nextLong();
        int k = in.nextInt();
        long y = in.nextInt();
        int[] a = in.readArray(n), b = in.readArray(m);

        out.println(testCase(n, m, x, k, y, a, b));
//        }

        out.close();
    }

    private static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    private static long testCase(int n, int m, int x, int k, int y, int[] a, int[] b) {
        long ans = 0;
        int i = 0, j = 0;
        List<Integer> toBeDestroyed;

        for (j = 0; j < m; j++) {
            toBeDestroyed = new ArrayList<>();

            while (i < n && a[i] != b[j]) toBeDestroyed.add(a[i++]);

            if (i >= n) return -1;

            long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, j == 0 ? -2 : b[j - 1], b[j], x <= y * k);

            if (manaNeeded == -1) return -1;
            else ans += manaNeeded;

            i++;
        }

        toBeDestroyed = new ArrayList<>();

        while (i < n) toBeDestroyed.add(a[i++]);

        long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, b[m - 1], -1, x <= y * k);

        if (manaNeeded == -1) return -1;
        else ans += manaNeeded;

        return ans;

        //debug
        /*for (int a1 : a) {
            System.out.print(a1 + " ");
        }
        System.out.println("END");*/
    }

    private static long manaToDestroy(List<Integer> warriors, int x, int k, int y, int leftWarrior, int rightWarrior, boolean isFireballCheaper) {
        if (warriors.size() == 0) return 0;

        if (isFireballCheaper) {
            return (long) x * (warriors.size() / k) + (long) y * (warriors.size() % k);
        } else {
            int max = -1;

            for (int warrior : warriors) {
                max = Math.max(max, warrior);
            }

            if (max > leftWarrior && max > rightWarrior) {
                //cannot berserk all the way
                return (long) x * (warriors.size() / k) + (long) y * (warriors.size() % k);
            } else {
                return (long) warriors.size() * y;
            }
        }
    }

    public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
//        int t = in.nextInt();  // Scanner has functions to read ints, longs, strings, chars, etc.
        //in.nextLine();
//        for (int i = 1; i <= t; ++i) {
        int n = in.nextInt(), m = in.nextInt();
        int x = in.nextInt(), k = in.nextInt(), y = in.nextInt();
        int[] a = in.readArray(n), b = in.readArray(m);

        out.println(testCase(n, m, x, k, y, a, b));
//        }

        out.close();
    }

    private static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    private static long testCase(int n, int m, long x, int k, long y, int[] a, int[] b) {
        long ans = 0;
        int i = 0, j = 0;
        List<Integer> toBeDestroyed;

        for (j = 0; j < m; j++) {
            toBeDestroyed = new ArrayList<>();

            while (i < n && a[i] != b[j]) toBeDestroyed.add(a[i++]);

            if (i >= n) return -1;

            long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, j == 0 ? -2 : b[j - 1], b[j]);

            if (manaNeeded == -1) return -1;
            else ans += manaNeeded;

            i++;
        }

        toBeDestroyed = new ArrayList<>();

        while (i < n) toBeDestroyed.add(a[i++]);

        long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, b[m - 1], -2);

        if (manaNeeded == -1) return -1;
        else ans += manaNeeded;

        return ans;
    }

    private static long manaToDestroy(List<Integer> warriors, long x, int k, long y, int leftWarrior, int rightWarrior) {
        long size = warriors.size();
        if (warriors.size() == 0) return 0;

        if (x <= y * k) {
            if (k > size) {
                int max = 0;
                for (int warrior : warriors) {
                    max = Math.max(max, warrior);
                }

                if (max > Math.max(leftWarrior, rightWarrior)) return -1;
                else return size * y;
            } else {
                return x * (size / k) + y * (size % k);
            }
        } else {
            int max = 0;

            for (int warrior : warriors) {
                max = Math.max(max, warrior);
            }

            if (max > Math.max(leftWarrior, rightWarrior)) {
                //cannot berserk all the way
                if (k > size) return -1;
                else return x + y * (size - k);
            } else {
                return size * y;
            }
        }
    }

    public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
//        int t = in.nextInt();  // Scanner has functions to read ints, longs, strings, chars, etc.
        //in.nextLine();
//        for (int i = 1; i <= t; ++i) {
        int n = in.nextInt(), m = in.nextInt();
        long x = in.nextLong();
        int k = in.nextInt();
        long y = in.nextInt();
        int[] a = in.readArray(n), b = in.readArray(m);

        out.println(testCase(n, m, x, k, y, a, b));
//        }

        out.close();
    }

    private static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    private static long testCase(int n, int m, long x, int k, long y, int[] a, int[] b) {
        long ans = 0;
        int i = 0, j = 0;
        List<Integer> toBeDestroyed;

        for (j = 0; j < m; j++) {
            toBeDestroyed = new ArrayList<>();

            while (i < n && a[i] != b[j]) toBeDestroyed.add(a[i++]);

            if (i >= n) return -1;

            long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, j == 0 ? -2 : b[j - 1], b[j]);

            if (manaNeeded == -1) return -1;
            else ans += manaNeeded;

            i++;
        }

        toBeDestroyed = new ArrayList<>();

        while (i < n) toBeDestroyed.add(a[i++]);

        long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, b[m - 1], -2);

        if (manaNeeded == -1) return -1;
        else ans += manaNeeded;

        return ans;
    }

    private static long manaToDestroy(List<Integer> warriors, long x, int k, long y, int leftWarrior, int rightWarrior) {
        long size = warriors.size();
        if (warriors.size() == 0) return 0;

        if (x <= y * k) {
            return x * (size / k) + y * (size % k);
        } else {
            int numStrongerWarriors = 0;

            for (int warrior : warriors) {
                if (warrior > Math.max(leftWarrior, rightWarrior)) numStrongerWarriors++;
            }

            if (numStrongerWarriors > 0) {
                //cannot berserk all the way
                long numFireBalls = (numStrongerWarriors + k - 1) / k;
                return x * numFireBalls + y * (size - (numFireBalls * k));
            } else {
                return size * y;
            }
        }
    }

    public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
//        int t = in.nextInt();  // Scanner has functions to read ints, longs, strings, chars, etc.
        //in.nextLine();
//        for (int i = 1; i <= t; ++i) {
        int n = in.nextInt(), m = in.nextInt();
        long x = in.nextLong();
        int k = in.nextInt();
        long y = in.nextInt();
        int[] a = in.readArray(n), b = in.readArray(m);

        out.println(testCase(n, m, x, k, y, a, b));
//        }

        out.close();
    }

    private static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    private static long testCase(int n, int m, long x, int k, long y, int[] a, int[] b) {
        long ans = 0;
        int i = 0, j = 0;
        List<Integer> toBeDestroyed;

        for (j = 0; j < m; j++) {
            toBeDestroyed = new ArrayList<>();

            while (i < n && a[i] != b[j]) toBeDestroyed.add(a[i++]);

            if (i >= n) return -1;

            long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, j == 0 ? -2 : b[j - 1], b[j], x <= y * k);

            if (manaNeeded == -1) return -1;
            else ans += manaNeeded;

            i++;
        }

        toBeDestroyed = new ArrayList<>();

        while (i < n) toBeDestroyed.add(a[i++]);

        long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, b[m - 1], -1, x <= y * k);

        if (manaNeeded == -1) return -1;
        else ans += manaNeeded;

        return ans;

        //debug
        /*for (int a1 : a) {
            System.out.print(a1 + " ");
        }
        System.out.println("END");*/
    }

    private static long manaToDestroy(List<Integer> warriors, long x, int k, long y, int leftWarrior, int rightWarrior, boolean isFireballCheaper) {
        long size = warriors.size();
        if (warriors.size() == 0) return 0;

        if (isFireballCheaper) {
            return x * (size / k) + y * (size % k);
        } else {
            int max = -1;

            for (int warrior : warriors) {
                max = Math.max(max, warrior);
            }

            if (max > leftWarrior && max > rightWarrior) {
                //cannot berserk all the way
                return x * (size / k) + y * (size % k);
            } else {
                return size * y;
            }
        }
    }

    public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
//        int t = in.nextInt();  // Scanner has functions to read ints, longs, strings, chars, etc.
        //in.nextLine();
//        for (int i = 1; i <= t; ++i) {
        int n = in.nextInt(), m = in.nextInt();
        long x = in.nextLong();
        int k = in.nextInt();
        long y = in.nextInt();
        int[] a = in.readArray(n), b = in.readArray(m);

        out.println(testCase(n, m, x, k, y, a, b));
//        }

        out.close();
    }

    private static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    private static long testCase(int n, int m, int x, int k, int y, int[] a, int[] b) {
        long ans = 0;
        int i = 0, j = 0;
        List<Integer> toBeDestroyed;

        for (j = 0; j < m; j++) {
            toBeDestroyed = new ArrayList<>();

            while (i < n && a[i] != b[j]) toBeDestroyed.add(a[i++]);

            if (i >= n) return -1;

            long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, j == 0 ? -2 : b[j - 1], b[j], x <= y * k);

            if (manaNeeded == -1) return -1;
            else ans += manaNeeded;

            i++;
        }

        toBeDestroyed = new ArrayList<>();

        while (i < n) toBeDestroyed.add(a[i++]);

        long manaNeeded = manaToDestroy(toBeDestroyed, x, k, y, b[m - 1], -1, x <= y * k);

        if (manaNeeded == -1) return -1;
        else ans += manaNeeded;

        return ans;

        //debug
        /*for (int a1 : a) {
            System.out.print(a1 + " ");
        }
        System.out.println("END");*/
    }

    private static long manaToDestroy(List<Integer> warriors, int x, int k, int y, int leftWarrior, int rightWarrior, boolean isFireballCheaper) {
        if (warriors.size() == 0) return 0;

        if (isFireballCheaper) {
            return x * (warriors.size() / k) + y * (warriors.size() % k);
        } else {
            int max = -1;

            for (int warrior : warriors) {
                max = Math.max(max, warrior);
            }

            if (max > leftWarrior && max > rightWarrior) {
                //cannot berserk all the way
                return x * (warriors.size() / k) + y * (warriors.size() % k);
            } else {
                return warriors.size() * y;
            }
        }
    }

    public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
//        int t = in.nextInt();  // Scanner has functions to read ints, longs, strings, chars, etc.
        //in.nextLine();
//        for (int i = 1; i <= t; ++i) {
        int n = in.nextInt(), m = in.nextInt();
        int x = in.nextInt(), k = in.nextInt(), y = in.nextInt();
        int[] a = in.readArray(n), b = in.readArray(m);

        out.println(testCase(n, m, x, k, y, a, b));
//        }

        out.close();
    }

    private static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}