import java.io.*;
import java.util.ArrayList;
import java.util.Random;
import java.util.StringTokenizer;

public class D {
    //Solution by Sathvik Kuthuru
    public static void main(String[] args) {
        FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = 1;
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);
        out.close();
    }

    static class Task {
        int n, m, k;
        long x, y;
        int[] a, b, pos;

        public void solve(int testNumber, FastReader scan, PrintWriter out) {
            n = scan.nextInt();
            m = scan.nextInt();
            x = scan.nextLong();
            k = scan.nextInt();
            y = scan.nextLong();
            a = new int[n];
            b = new int[m];
            pos = new int[n + 1];
            for(int i = 0; i < n; i++) pos[a[i] = scan.nextInt()] = i;
            for(int i = 0; i < m; i++) {
                b[i] = scan.nextInt();
                if(i > 0 && pos[b[i]] < pos[b[i - 1]]) {
                    out.println(-1);
                    return;
                }
            }
            if(m > n) {
                out.println(-1);
                return;
            }
            long ans = get(-1, pos[b[0]]);
            if(ans == -1) {
                out.println(-1);
                return;
            }
            for(int i = 1; i < m; i++) {
                long curr = get(pos[b[i - 1]], pos[b[i]]);
                if(curr == -1) {
                    out.println(-1);
                    return;
                }
                ans += curr;
            }
            long last = get(pos[b[m - 1]], n);
            if(last == -1) {
                out.println(-1);
                return;
            }
            ans += last;
            out.println(ans);
        }

        long get(int start, int end) {
            if(end == start + 1) return 0;
            int max = 0;
            if(start >= 0 && a[start] > max) max = a[start];
            if(end < n && a[end] > max) max = a[end];
            int bigger = 0;
            for(int i = start + 1; i < end; i++) {
                if(a[i] > max) bigger++;
            }
            int have = end - start - 1;
            if(x >= y * k) {
                if(bigger == 0) {
                    return y * have;
                }
                else if(have < k){
                    return -1;
                }
                else {

                    return y * (have - k) + x;
                }
            }
            else {
                if(have < k && bigger > 0) return -1;
                else {
                    return (have / k * x) + (have % k) * y;
                }
            }
        }
    }

    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;
        }
    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class D {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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 FastReader s = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    private static int[] rai(int n) {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }
        return arr;
    }

    private static int[][] rai(int n, int m) {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextInt();
            }
        }
        return arr;
    }

    private static long[] ral(int n) {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        return arr;
    }

    private static long[][] ral(int n, int m) {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextLong();
            }
        }
        return arr;
    }

    private static int ri() {
        return s.nextInt();
    }

    private static long rl() {
        return s.nextLong();
    }

    private static String rs() {
        return s.next();
    }

    static int gcd(int a,int b)
    {
        if(b==0)
        {
            return a;
        }
        return gcd(b,a%b);
    }

    static boolean isPrime(int n) {
        //check if n is a multiple of 2
        if (n % 2 == 0) return false;
        //if not, then just check the odds
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    static long getCost(List<Integer> list,int[] arr,long x,long k,long y,int lastInd,int currInd)
    {

        if(list.size()!=0)
        {
            long cost=0;
            int max=Integer.MIN_VALUE;
            for(int i:list)
            {
                max=Math.max(i,max);
            }
            if(list.size()<k)
            {
                long c1=Long.MAX_VALUE,c2=Long.MAX_VALUE;
                if(lastInd!=-1 && arr[lastInd]>max)
                {
                    c1=(long)list.size()*y;
                }
                if(currInd<arr.length && arr[currInd]>max)
                {
                    c2=(long)list.size()*y;
                }
                if(c1==Long.MAX_VALUE &&  c2==Long.MAX_VALUE)
                {
                    return -1;
                }
                else {
                    return Math.min(c1,c2);
                }
            }

            int size=list.size();

            while(size%k!=0)
            {
                size--;
                cost+=y;
            }

//            int len= (int)(size- (size/k)*k);
//            size-=len;
//            cost+=y*len;

            boolean c1=false,c2=false;
            if(lastInd>=0 && lastInd<arr.length &&  arr[lastInd]>max)
            {
                c1=true;
            }
            if(currInd>=0 && currInd<arr.length && arr[currInd]>max)
            {
                c2=true;
            }

//            if(x<=(y*k))
//            {
//                int len= (int)(size- (size/k)*k);
//                size-=len;
//                cost+=y*len;
//                cost+=(size/k)*x;
//            }
//            else
//            {
//                if(c1 ||c2)
//                {
//                    cost+=size*y;
//                }
//                else
//                {
//                    cost+=x+(size-k)*y;
//                }
//            }

            if(c1 || c2)
            {
                if(x<=(y*k))
                {
                    cost+=(size/k)*x;
                }
                else
                {
                    cost+=y*size;
                }
            }
            else
            {
                if(x<=(y*k))
                {
                    cost+=(size/k)*x;
                }
                else
                {
                    cost+=x+y*(size-k);
                }
//                cost+=(size/k)*x;
            }
            return cost;

        }
        return 0;
    }
    public static void main(String[] args) {
        StringBuilder ans = new StringBuilder();
//        int t = ri();
        int t=1;
        while (t-- > 0) {
            int n = ri();
            int m = ri();
            long x = rl();
            long k = rl();
            long y = rl();
            int[] arr = rai(n);
            int[] b = rai(m);

            int j = 0;
            List<Integer> list=new ArrayList<>();
            int total=0;
            int last=-1;
            long res=0;
            int i=0;
            int flag=0;
            for (; i < n; i++)
            {
                if(j>=m)
                {
                    list.add(arr[i]);
                    continue;
                }
                if(arr[i]==b[j])
                {

                    total+=list.size();
                    j++;
                    long cost=getCost(list,arr,x,k,y,last,i);
                    if(cost==-1)
                    {
                        ans.append("-1\n");
                        flag=1;
                        break;
                    }
                    res+=cost;

//                    System.out.println(list+" "+cost+" "+i);
                    last=i;
                    list=new ArrayList<>();
                }
                else
                {
                    list.add(arr[i]);
                }
            }
            if(flag==1)
            {
                break;
            }
            total+=list.size();
            long cost=getCost(list,arr,x,k,y,last,i);
            res+=cost;
//            System.out.println(list+" "+cost);
//            System.out.println("Total= "+total);
            if(j<m)
            {
                ans.append("-1\n");
                break;
            }
            ans.append(res).append("\n");

        }
        out.print(ans.toString());
        out.flush();

    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class D {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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 FastReader s = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    private static int[] rai(int n) {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }
        return arr;
    }

    private static int[][] rai(int n, int m) {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextInt();
            }
        }
        return arr;
    }

    private static long[] ral(int n) {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        return arr;
    }

    private static long[][] ral(int n, int m) {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextLong();
            }
        }
        return arr;
    }

    private static int ri() {
        return s.nextInt();
    }

    private static long rl() {
        return s.nextLong();
    }

    private static String rs() {
        return s.next();
    }

    static int gcd(int a,int b)
    {
        if(b==0)
        {
            return a;
        }
        return gcd(b,a%b);
    }

    static boolean isPrime(int n) {
        //check if n is a multiple of 2
        if (n % 2 == 0) return false;
        //if not, then just check the odds
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    static long getCost(List<Integer> list,int[] arr,long x,long k,long y,int lastInd,int currInd)
    {

        if(list.size()!=0)
        {
            long cost=0;
            int max=Integer.MIN_VALUE;
            for(int i:list)
            {
                max=Math.max(i,max);
            }
            if(list.size()<k)
            {
                long c1=Long.MAX_VALUE,c2=Long.MAX_VALUE;
                if(lastInd!=-1 && arr[lastInd]>max)
                {
                    c1=(long)list.size()*y;
                }
                if(currInd<arr.length && arr[currInd]>max)
                {
                    c2=(long)list.size()*y;
                }
                if(c1==Long.MAX_VALUE &&  c2==Long.MAX_VALUE)
                {
                    return -1;
                }
                else {
                    return Math.min(c1,c2);
                }
            }

            int size=list.size();
//            while(size%k!=0)
//            {
//                size--;
//                cost+=y;
//            }

            boolean c1=false,c2=false;
            if(lastInd>=0 && lastInd<arr.length &&  arr[lastInd]>max)
            {
                c1=true;
            }
            if(currInd>=0 && currInd<arr.length && arr[currInd]>max)
            {
                c2=true;
            }

            if(x<=(y*k))
            {
                int len= (int)(size- (size/k)*k);
                size-=len;
                cost+=y*len;
                cost+=(size/k)*x;
            }
            else
            {
                if(c1 ||c2)
                {
                    cost+=size*y;
                }
                else
                {
                    cost+=x+(size-k)*y;
                }
            }

//            if(c1 || c2)
//            {
//                if(x<=(y*k))
//                {
//                    cost+=(size/k)*x;
//                }
//                else
//                {
//                    cost+=y*k;
//                }
//            }
//            else
//            {
//                cost+=(size/k)*x;
//            }
            return cost;

        }
        return 0;
    }
    public static void main(String[] args) {
        StringBuilder ans = new StringBuilder();
//        int t = ri();
        int t=1;
        while (t-- > 0) {
            int n = ri();
            int m = ri();
            long x = rl();
            long k = rl();
            long y = rl();
            int[] arr = rai(n);
            int[] b = rai(m);

            int j = 0;
            List<Integer> list=new ArrayList<>();
            int total=0;
            int last=-1;
            long res=0;
            int i=0;
            for (; i < n; i++)
            {
                if(j>=m)
                {
                    list.add(arr[i]);
                    continue;
                }
                if(arr[i]==b[j])
                {

                    total+=list.size();
                    j++;
                    long cost=getCost(list,arr,x,k,y,last,i);
                    if(cost==-1)
                    {
                        ans.append("-1\n");
                        break;
                    }
                    res+=cost;

//                    System.out.println(list+" "+cost+" "+i);
                    last=i;
                    list=new ArrayList<>();
                }
                else
                {
                    list.add(arr[i]);
                }
            }
            total+=list.size();
            long cost=getCost(list,arr,x,k,y,last,i);
            res+=cost;
//            System.out.println(list+" "+cost);
//            System.out.println("Total= "+total);
            if(j<m)
            {
                ans.append("-1\n");
                break;
            }
            ans.append(res).append("\n");

        }
        out.print(ans.toString());
        out.flush();

    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class D {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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 FastReader s = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    private static int[] rai(int n) {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }
        return arr;
    }

    private static int[][] rai(int n, int m) {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextInt();
            }
        }
        return arr;
    }

    private static long[] ral(int n) {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        return arr;
    }

    private static long[][] ral(int n, int m) {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextLong();
            }
        }
        return arr;
    }

    private static int ri() {
        return s.nextInt();
    }

    private static long rl() {
        return s.nextLong();
    }

    private static String rs() {
        return s.next();
    }

    static int gcd(int a,int b)
    {
        if(b==0)
        {
            return a;
        }
        return gcd(b,a%b);
    }

    static boolean isPrime(int n) {
        //check if n is a multiple of 2
        if (n % 2 == 0) return false;
        //if not, then just check the odds
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    static long getCost(List<Integer> list,int[] arr,long x,long k,long y,int lastInd,int currInd)
    {

        if(list.size()!=0)
        {
            long cost=0;
            int max=Integer.MIN_VALUE;
            for(int i:list)
            {
                max=Math.max(i,max);
            }
            if(list.size()<k)
            {
                long c1=Long.MAX_VALUE,c2=Long.MAX_VALUE;
                if(lastInd!=-1 && arr[lastInd]>max)
                {
                    c1=(long)list.size()*y;
                }
                if(currInd<arr.length && arr[currInd]>max)
                {
                    c2=(long)list.size()*y;
                }
                if(c1==Long.MAX_VALUE &&  c2==Long.MAX_VALUE)
                {
                    return -1;
                }
                else {
                    return Math.min(c1,c2);
                }
            }

            int size=list.size();
//            while(size%k!=0)
//            {
//                size--;
//                cost+=y;
//            }

            boolean c1=false,c2=false;
            if(lastInd>=0 && lastInd<arr.length &&  arr[lastInd]>max)
            {
                c1=true;
            }
            if(currInd>=0 && currInd<arr.length && arr[currInd]>max)
            {
                c2=true;
            }

            if(x<=(y*k))
            {
                int len= (int)(size- (size/k)*k);
                size-=len;
                cost+=y*len;
                cost+=(size/k)*x;
            }
            else
            {
                if(c1 ||c2)
                {
                    cost+=size*y;
                }
                else
                {
                    cost+=x+(size-k)*y;
                }
            }

//            if(c1 || c2)
//            {
//                if(x<=(y*k))
//                {
//                    cost+=(size/k)*x;
//                }
//                else
//                {
//                    cost+=y*k;
//                }
//            }
//            else
//            {
//                cost+=(size/k)*x;
//            }
            return cost;

        }
        return 0;
    }
    public static void main(String[] args) {
        StringBuilder ans = new StringBuilder();
//        int t = ri();
        int t=1;
        while (t-- > 0) {
            int n = ri();
            int m = ri();
            long x = rl();
            long k = rl();
            long y = rl();
            int[] arr = rai(n);
            int[] b = rai(m);

            int j = 0;
            List<Integer> list=new ArrayList<>();
            int total=0;
            int last=-1;
            long res=0;
            int i=0;
            int flag=0;
            for (; i < n; i++)
            {
                if(j>=m)
                {
                    list.add(arr[i]);
                    continue;
                }
                if(arr[i]==b[j])
                {

                    total+=list.size();
                    j++;
                    long cost=getCost(list,arr,x,k,y,last,i);
                    if(cost==-1)
                    {
                        ans.append("-1\n");
                        flag=1;
                        break;
                    }
                    res+=cost;

//                    System.out.println(list+" "+cost+" "+i);
                    last=i;
                    list=new ArrayList<>();
                }
                else
                {
                    list.add(arr[i]);
                }
            }
            if(flag==1)
            {
                break;
            }
            total+=list.size();
            long cost=getCost(list,arr,x,k,y,last,i);
            res+=cost;
//            System.out.println(list+" "+cost);
//            System.out.println("Total= "+total);
            if(n-total!=m)
            {
                ans.append("-1\n");
                break;
            }
            ans.append(res).append("\n");

        }
        out.print(ans.toString());
        out.flush();

    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class D {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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 FastReader s = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    private static int[] rai(int n) {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }
        return arr;
    }

    private static int[][] rai(int n, int m) {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextInt();
            }
        }
        return arr;
    }

    private static long[] ral(int n) {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        return arr;
    }

    private static long[][] ral(int n, int m) {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextLong();
            }
        }
        return arr;
    }

    private static int ri() {
        return s.nextInt();
    }

    private static long rl() {
        return s.nextLong();
    }

    private static String rs() {
        return s.next();
    }

    static int gcd(int a,int b)
    {
        if(b==0)
        {
            return a;
        }
        return gcd(b,a%b);
    }

    static boolean isPrime(int n) {
        //check if n is a multiple of 2
        if (n % 2 == 0) return false;
        //if not, then just check the odds
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    static long getCost(List<Integer> list,int[] arr,long x,long k,long y,int lastInd,int currInd)
    {

        if(list.size()!=0)
        {
            long cost=0;
            int max=Integer.MIN_VALUE;
            for(int i:list)
            {
                max=Math.max(i,max);
            }
            if(list.size()<k)
            {
                long c1=Long.MAX_VALUE,c2=Long.MAX_VALUE;
                if(lastInd!=-1 && arr[lastInd]>max)
                {
                    c1=(long)list.size()*y;
                }
                if(currInd<arr.length && arr[currInd]>max)
                {
                    c2=(long)list.size()*y;
                }
                if(c1==Long.MAX_VALUE &&  c2==Long.MAX_VALUE)
                {
                    return -1;
                }
                else {
                    return Math.min(c1,c2);
                }
            }

            int size=list.size();

//            while(size%k!=0)
//            {
//                size--;
//                cost+=y;
//            }

            int len= (int)(size- (size/k)*k);
            size-=len;
            cost+=y*len;

            boolean c1=false,c2=false;
            if(lastInd>=0 && lastInd<arr.length &&  arr[lastInd]>max)
            {
                c1=true;
            }
            if(currInd>=0 && currInd<arr.length && arr[currInd]>max)
            {
                c2=true;
            }

//            if(x<=(y*k))
//            {
//                int len= (int)(size- (size/k)*k);
//                size-=len;
//                cost+=y*len;
//                cost+=(size/k)*x;
//            }
//            else
//            {
//                if(c1 ||c2)
//                {
//                    cost+=size*y;
//                }
//                else
//                {
//                    cost+=x+(size-k)*y;
//                }
//            }

            if(c1 || c2)
            {
                if(x<=(y*k))
                {
                    cost+=(size/k)*x;
                }
                else
                {
                    cost+=y*k;
                }
            }
            else
            {
                if(x<=(y*k))
                {
                    cost+=(size/k)*x;
                }
                else
                {
                    cost+=x+y*(size-k);
                }
//                cost+=(size/k)*x;
            }
            return cost;

        }
        return 0;
    }
    public static void main(String[] args) {
        StringBuilder ans = new StringBuilder();
//        int t = ri();
        int t=1;
        while (t-- > 0) {
            int n = ri();
            int m = ri();
            long x = rl();
            long k = rl();
            long y = rl();
            int[] arr = rai(n);
            int[] b = rai(m);

            int j = 0;
            List<Integer> list=new ArrayList<>();
            int total=0;
            int last=-1;
            long res=0;
            int i=0;
            int flag=0;
            for (; i < n; i++)
            {
                if(j>=m)
                {
                    list.add(arr[i]);
                    continue;
                }
                if(arr[i]==b[j])
                {

                    total+=list.size();
                    j++;
                    long cost=getCost(list,arr,x,k,y,last,i);
                    if(cost==-1)
                    {
                        ans.append("-1\n");
                        flag=1;
                        break;
                    }
                    res+=cost;

//                    System.out.println(list+" "+cost+" "+i);
                    last=i;
                    list=new ArrayList<>();
                }
                else
                {
                    list.add(arr[i]);
                }
            }
            if(flag==1)
            {
                break;
            }
            total+=list.size();
            long cost=getCost(list,arr,x,k,y,last,i);
            res+=cost;
//            System.out.println(list+" "+cost);
//            System.out.println("Total= "+total);
            if(j<m)
            {
                ans.append("-1\n");
                break;
            }
            ans.append(res).append("\n");

        }
        out.print(ans.toString());
        out.flush();

    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class D {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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 FastReader s = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    private static int[] rai(int n) {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }
        return arr;
    }

    private static int[][] rai(int n, int m) {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextInt();
            }
        }
        return arr;
    }

    private static long[] ral(int n) {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        return arr;
    }

    private static long[][] ral(int n, int m) {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextLong();
            }
        }
        return arr;
    }

    private static int ri() {
        return s.nextInt();
    }

    private static long rl() {
        return s.nextLong();
    }

    private static String rs() {
        return s.next();
    }

    static int gcd(int a,int b)
    {
        if(b==0)
        {
            return a;
        }
        return gcd(b,a%b);
    }

    static boolean isPrime(int n) {
        //check if n is a multiple of 2
        if (n % 2 == 0) return false;
        //if not, then just check the odds
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    static long getCost(List<Integer> list,int[] arr,long x,long k,long y,int lastInd,int currInd)
    {

        if(list.size()!=0)
        {
            long cost=0;
            int max=Integer.MIN_VALUE;
            for(int i:list)
            {
                max=Math.max(i,max);
            }
            if(list.size()<k)
            {
                long c1=Long.MAX_VALUE,c2=Long.MAX_VALUE;
                if(lastInd!=-1 && arr[lastInd]>max)
                {
                    c1=list.size()*y;
                }
                if(currInd<arr.length && arr[currInd]>max)
                {
                    c2=list.size()*y;
                }
                if(c1==Long.MAX_VALUE &&  c2==Long.MAX_VALUE)
                {
                    return -1;
                }
                else {
                    return Math.min(c1,c2);
                }
            }

            int size=list.size();
            while(size%k!=0)
            {
                size--;
                cost+=y;
            }

            boolean c1=false,c2=false;
            if(lastInd>=0 && lastInd<arr.length &&  arr[lastInd]>max)
            {
                c1=true;
            }
            if(currInd>=0 && currInd<arr.length && arr[currInd]>max)
            {
                c2=true;
            }
            if(c1 || c2)
            {
                if(x<=(y*k))
                {
                    cost+=(size/k)*x;
                }
                else
                {
                    cost+=y*k;
                }
            }
            else
            {
                cost+=(size/k)*x;
            }
            return cost;

        }
        return 0;
    }
    public static void main(String[] args) {
        StringBuilder ans = new StringBuilder();
//        int t = ri();
        int t=1;
        while (t-- > 0) {
            int n = ri();
            int m = ri();
            long x = rl();
            long k = rl();
            long y = rl();
            int[] arr = rai(n);
            int[] b = rai(m);

            int j = 0;
            List<Integer> list=new ArrayList<>();
            int total=0;
            int last=-1;
            long res=0;
            int i=0;
            for (; i < n; i++)
            {
                if(j>=m)
                {
                    list.add(arr[i]);
                    continue;
                }
                if(arr[i]==b[j])
                {

                    total+=list.size();
                    j++;
                    long cost=getCost(list,arr,x,k,y,last,i);
                    res+=cost;

//                    System.out.println(list+" "+cost);
                    last=i;
                    list=new ArrayList<>();
                }
                else
                {
                    list.add(arr[i]);
                }
            }
            total+=list.size();
            long cost=getCost(list,arr,x,k,y,last,i);
            res+=cost;
//            System.out.println(list+" "+cost);
//            System.out.println("Total= "+total);
            if(n-total!=m)
            {
                ans.append("-1\n");
                break;
            }
            ans.append(res).append("\n");

        }
        out.print(ans.toString());
        out.flush();

    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class D {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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 FastReader s = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    private static int[] rai(int n) {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }
        return arr;
    }

    private static int[][] rai(int n, int m) {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextInt();
            }
        }
        return arr;
    }

    private static long[] ral(int n) {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        return arr;
    }

    private static long[][] ral(int n, int m) {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextLong();
            }
        }
        return arr;
    }

    private static int ri() {
        return s.nextInt();
    }

    private static long rl() {
        return s.nextLong();
    }

    private static String rs() {
        return s.next();
    }

    static int gcd(int a,int b)
    {
        if(b==0)
        {
            return a;
        }
        return gcd(b,a%b);
    }

    static boolean isPrime(int n) {
        //check if n is a multiple of 2
        if (n % 2 == 0) return false;
        //if not, then just check the odds
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    static long getCost(List<Integer> list,int[] arr,long x,long k,long y,int lastInd,int currInd)
    {

        if(list.size()!=0)
        {
            long cost=0;
            int max=Integer.MIN_VALUE;
            for(int i:list)
            {
                max=Math.max(i,max);
            }
            if(list.size()<k)
            {
                long c1=Long.MAX_VALUE,c2=Long.MAX_VALUE;
                if(lastInd!=-1 && arr[lastInd]>max)
                {
                    c1=(long)list.size()*y;
                }
                if(currInd<arr.length && arr[currInd]>max)
                {
                    c2=(long)list.size()*y;
                }
                if(c1==Long.MAX_VALUE &&  c2==Long.MAX_VALUE)
                {
                    return -1;
                }
                else {
                    return Math.min(c1,c2);
                }
            }

            int size=list.size();

//            while(size%k!=0)
//            {
//                size--;
//                cost+=y;
//            }

            int len= (int)(size- (size/k)*k);
            size-=len;
            cost+=y*len;

            boolean c1=false,c2=false;
            if(lastInd>=0 && lastInd<arr.length &&  arr[lastInd]>max)
            {
                c1=true;
            }
            if(currInd>=0 && currInd<arr.length && arr[currInd]>max)
            {
                c2=true;
            }

//            if(x<=(y*k))
//            {
//                int len= (int)(size- (size/k)*k);
//                size-=len;
//                cost+=y*len;
//                cost+=(size/k)*x;
//            }
//            else
//            {
//                if(c1 ||c2)
//                {
//                    cost+=size*y;
//                }
//                else
//                {
//                    cost+=x+(size-k)*y;
//                }
//            }

            if(c1 || c2)
            {
                if(x<=(y*k))
                {
                    cost+=(size/k)*x;
                }
                else
                {
                    cost+=y*size;
                }
            }
            else
            {
                if(x<=(y*k))
                {
                    cost+=(size/k)*x;
                }
                else
                {
                    cost+=x+y*(size-k);
                }
//                cost+=(size/k)*x;
            }
            return cost;

        }
        return 0;
    }
    public static void main(String[] args) {
        StringBuilder ans = new StringBuilder();
//        int t = ri();
        int t=1;
        while (t-- > 0) {
            int n = ri();
            int m = ri();
            long x = rl();
            long k = rl();
            long y = rl();
            int[] arr = rai(n);
            int[] b = rai(m);

            int j = 0;
            List<Integer> list=new ArrayList<>();
            int total=0;
            int last=-1;
            long res=0;
            int i=0;
            int flag=0;
            for (; i < n; i++)
            {
                if(j>=m)
                {
                    list.add(arr[i]);
                    continue;
                }
                if(arr[i]==b[j])
                {

                    total+=list.size();
                    j++;
                    long cost=getCost(list,arr,x,k,y,last,i);
                    if(cost==-1)
                    {
                        ans.append("-1\n");
                        flag=1;
                        break;
                    }
                    res+=cost;

//                    System.out.println(list+" "+cost+" "+i);
                    last=i;
                    list=new ArrayList<>();
                }
                else
                {
                    list.add(arr[i]);
                }
            }
            if(flag==1)
            {
                break;
            }
            total+=list.size();
            long cost=getCost(list,arr,x,k,y,last,i);
            res+=cost;
//            System.out.println(list+" "+cost);
//            System.out.println("Total= "+total);
            if(j<m)
            {
                ans.append("-1\n");
                break;
            }
            ans.append(res).append("\n");

        }
        out.print(ans.toString());
        out.flush();

    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class D {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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 FastReader s = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    private static int[] rai(int n) {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }
        return arr;
    }

    private static int[][] rai(int n, int m) {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextInt();
            }
        }
        return arr;
    }

    private static long[] ral(int n) {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        return arr;
    }

    private static long[][] ral(int n, int m) {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextLong();
            }
        }
        return arr;
    }

    private static int ri() {
        return s.nextInt();
    }

    private static long rl() {
        return s.nextLong();
    }

    private static String rs() {
        return s.next();
    }

    static int gcd(int a,int b)
    {
        if(b==0)
        {
            return a;
        }
        return gcd(b,a%b);
    }

    static boolean isPrime(int n) {
        //check if n is a multiple of 2
        if (n % 2 == 0) return false;
        //if not, then just check the odds
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    static long getCost(List<Integer> list,int[] arr,long x,long k,long y,int lastInd,int currInd)
    {

        if(list.size()!=0)
        {
            long cost=0;
            int max=Integer.MIN_VALUE;
            for(int i:list)
            {
                max=Math.max(i,max);
            }
            if(list.size()<k)
            {
                long c1=Long.MAX_VALUE,c2=Long.MAX_VALUE;
                if(lastInd!=-1 && arr[lastInd]>max)
                {
                    c1=(long)list.size()*y;
                }
                if(currInd<arr.length && arr[currInd]>max)
                {
                    c2=(long)list.size()*y;
                }
                if(c1==Long.MAX_VALUE &&  c2==Long.MAX_VALUE)
                {
                    return -1;
                }
                else {
                    return Math.min(c1,c2);
                }
            }

            int size=list.size();
//            while(size%k!=0)
//            {
//                size--;
//                cost+=y;
//            }

            boolean c1=false,c2=false;
            if(lastInd>=0 && lastInd<arr.length &&  arr[lastInd]>max)
            {
                c1=true;
            }
            if(currInd>=0 && currInd<arr.length && arr[currInd]>max)
            {
                c2=true;
            }

            if(x<=(y*k))
            {
                int len= (int)(size- (size/k)*k);
                size-=len;
                cost+=y*len;
                cost+=(size/k)*x;
            }
            else
            {
                if(c1 ||c2)
                {
                    cost+=size*y;
                }
                else
                {
                    cost+=x+(size-k)*y;
                }
            }

//            if(c1 || c2)
//            {
//                if(x<=(y*k))
//                {
//                    cost+=(size/k)*x;
//                }
//                else
//                {
//                    cost+=y*k;
//                }
//            }
//            else
//            {
//                cost+=(size/k)*x;
//            }
            return cost;

        }
        return 0;
    }
    public static void main(String[] args) {
        StringBuilder ans = new StringBuilder();
//        int t = ri();
        int t=1;
        while (t-- > 0) {
            int n = ri();
            int m = ri();
            long x = rl();
            long k = rl();
            long y = rl();
            int[] arr = rai(n);
            int[] b = rai(m);

            int j = 0;
            List<Integer> list=new ArrayList<>();
            int total=0;
            int last=-1;
            long res=0;
            int i=0;
            int flag=0;
            for (; i < n; i++)
            {
                if(j>=m)
                {
                    list.add(arr[i]);
                    continue;
                }
                if(arr[i]==b[j])
                {

                    total+=list.size();
                    j++;
                    long cost=getCost(list,arr,x,k,y,last,i);
                    if(cost==-1)
                    {
                        ans.append("-1\n");
                        flag=1;
                        break;
                    }
                    res+=cost;

//                    System.out.println(list+" "+cost+" "+i);
                    last=i;
                    list=new ArrayList<>();
                }
                else
                {
                    list.add(arr[i]);
                }
            }
            if(flag==1)
            {
                break;
            }
            total+=list.size();
            long cost=getCost(list,arr,x,k,y,last,i);
            res+=cost;
//            System.out.println(list+" "+cost);
//            System.out.println("Total= "+total);
            if(j<m)
            {
                ans.append("-1\n");
                break;
            }
            ans.append(res).append("\n");

        }
        out.print(ans.toString());
        out.flush();

    }

}


import java.io.*;
import java.util.*;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class Ans implements Runnable {

	public static void main(String args[]) throws Exception {
		Ans s = new Ans();
		s.run();

	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	static int[] Indexes = new int[(int)(2e5+5)];

	public void run() {
		InputReader sc = new InputReader(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int k = sc.nextInt();
		int y = sc.nextInt();
		int[] A = new int[n];
		int[] B = new int[m+1];
		B[m] = (int)(1e9+8);
		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		for (int i = 0; i < m; i++) {
			B[i] = sc.nextInt();
		}

		boolean flag = getSegments(A, B);
		if(!flag){
			System.out.println(-1);
			return;
		}

		int ans = 0;
		boolean valid = true;
		for (int i = 1; i <= m; i++) {
			if (B[i] > B[i - 1]) {
				int temp = solveSegment(B[i - 1], B[i], A, k, x, y, m);
				if (temp == -1) {
					valid = false;
					break;
				}
				ans += temp;
			} else {
				valid = false;
				break;
			}
		}
		if (!valid) {
			pw.println(-1);
		} else {
			pw.println(ans);
		}

		pw.close();

	}

	static int solveSegment(int lind, int rind, int[] A, int k, int x, int y, int m) {
		int l = A[lind];
		int r = (rind < m) ? A[rind] : (int)(1e9+9);
		int total = rind - lind - 1;
		int ans = 0;
		if (total % k != 0) {
			if (total > k) {
				ans += total % k;
				ans += solveK((total / k) * k, k, x, y, lind, rind, A);
			} else {
				int p = -1;
				for (int i = lind + 1; i < rind; i++) {
					p = max(A[i], p);
				}
				if ((r > p) || (l > p)) {
					ans += total*y;
				} else {
					return -1;
				}
			}
		} else {
			ans += solveK(total, k, x, y, lind, rind, A);
		}

		return ans;
	}

	static int solveK(int total, int k, int x, int y, int lind, int rind, int[] A) {
		boolean fire = (x < k * y) ? true : false;
		if (fire) {
			return (total / k) * x;
		}
		return x + (total - k) * y;

	}

	static boolean getSegments(int[] A, int[] B) {
		int ind = 0;
		for (int i = 0; i < A.length; i++) {
			if (ind < B.length && B[ind] == A[i]) {
				B[ind] = i;
				ind++;
			}
		}
		B[B.length-1] = A.length;

		return ind >= B.length-1;
	}

	static boolean isPrime(int n) {
		for (int i = 2; i <= sqrt(n); i++) {
			if (n % i == 0) {
				return false;
			}
		}
		return true;
	}

	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();

			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}

				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String stock = "";
			try {
				stock = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return stock;
		}

		public int nextInt() {
			int c = read();

			while (isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-') {
				sgn = -1;
				c = read();
			}

			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public double nextDouble() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') {
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) {
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return readString();
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}


import java.io.*;
import java.util.*;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class Ans implements Runnable {

	public static void main(String args[]) throws Exception {
		Ans s = new Ans();
		s.run();

	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	InputReader sc = new InputReader(System.in);
	PrintWriter pw = new PrintWriter(System.out);

	public void run() {

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int k = sc.nextInt();
		int y = sc.nextInt();
		int[] A = new int[n];
		int[] B = new int[m+1];
		B[m] = (int)(1e9+8);
		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		for (int i = 0; i < m; i++) {
			B[i] = sc.nextInt();
		}
		int aind = 0;
		long ans = 0;
		for(int i = 0 ; i < m; i++){
			int left = aind;
			while(aind < n && A[aind] != B[i]){
				aind++;
			}
			if(aind >= n){
				System.out.println(-1);
				return;
			}
			long temp = solve(left, aind, x, k ,y, A);
			if(temp == -1){
				System.out.println(-1);
				return;
			}
			ans += temp;
			aind++;
		}
		long temp = solve(aind, n, x, k, y, A);
		if(temp == -1){ pw.println(-1); return;}
		ans += temp;
		pw.println(ans);
		pw.close();

	}

	static long solve(int l, int r, int x, int k, int y, int[] A){
		if(l == r) { return 0;}
		int maxp = max(l-1 >= 0 ? A[l-1] : 0, r < A.length ? A[r] : 0);
		boolean flag = false;
		for(int i = 0 ;i < A.length; i++){
			if(A[i] > maxp){
				flag = true;
				break;
			}
		}
		long ans = Long.MAX_VALUE;
		if(!flag){
			ans = min(ans, (r-l)*y);
		}
		if(r-l >= k){
			ans = min(ans, ((r-l)/k)*x + ((r-l)%k)*y);
			ans = min(ans, x + (r-l-k)*y);
		}else if(flag){
			return -1;
		}

		return ans;
	}

	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();

			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}

				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String stock = "";
			try {
				stock = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return stock;
		}

		public int nextInt() {
			int c = read();

			while (isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-') {
				sgn = -1;
				c = read();
			}

			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public double nextDouble() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') {
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) {
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return readString();
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}


import java.io.*;
import java.util.*;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class Ans implements Runnable {

	public static void main(String args[]) throws Exception {
		Ans s = new Ans();
		s.run();

	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	InputReader sc = new InputReader(System.in);
	PrintWriter pw = new PrintWriter(System.out);

	public void run() {

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int k = sc.nextInt();
		int y = sc.nextInt();
		int[] A = new int[n];
		int[] B = new int[m+1];
		B[m] = (int)(1e9+8);
		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		for (int i = 0; i < m; i++) {
			B[i] = sc.nextInt();
		}
		int aind = 0;
		long ans = 0;
		for(int i = 0 ; i < m; i++){
			int left = aind;
			while(aind < n && A[aind] != B[i]){
				aind++;
			}
			if(aind >= n){
				System.out.println(-1);
				return;
			}
			long temp = solve(left, aind, x, k ,y, A);
			if(temp == -1){
				System.out.println(-1);
				return;
			}
			ans += temp;
			aind++;
		}
		long temp = solve(aind, n, x, k, y, A);
		if(temp == -1){ pw.println(-1); return;}
		ans += temp;
		pw.println(ans);
		pw.close();

	}

	static long solve(int l, int r, int x, int k, int y, int[] A){
		if(l == r) { return 0;}
		int maxp = max(l-1 >= 0 ? A[l-1] : 0, r < A.length ? A[r] : 0);
		boolean flag = false;

		for(int i = l ;i < r; i++){
			if(A[i] > maxp){
				flag = true;
				break;
			}
		}
		long ans = Long.MAX_VALUE;
		if(!flag){
			ans = min(ans, (r-l)*y);
		}
		if(r-l >= k){
			ans = min(ans, ((r-l)/k)*x + ((r-l)%k)*y);
			ans = min(ans, x + (r-l-k)*y);
		}else if(flag){
			return -1;
		}

		return ans;
	}

	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();

			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}

				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String stock = "";
			try {
				stock = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return stock;
		}

		public int nextInt() {
			int c = read();

			while (isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-') {
				sgn = -1;
				c = read();
			}

			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public double nextDouble() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') {
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) {
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return readString();
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}


import java.io.*;
import java.util.*;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class Ans implements Runnable {

	public static void main(String args[]) throws Exception {
		Ans s = new Ans();
		s.run();

	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	InputReader sc = new InputReader(System.in);
	PrintWriter pw = new PrintWriter(System.out);

	public void run() {

		int n = sc.nextInt();
		int m = sc.nextInt();
		long x = sc.nextLong();
		long k = sc.nextLong();
		long y = sc.nextLong();
		int[] A = new int[n];
		int[] B = new int[m+1];
		B[m] = (int)(1e9+8);
		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		for (int i = 0; i < m; i++) {
			B[i] = sc.nextInt();
		}
		int aind = 0;
		long ans = 0;
		for(int i = 0 ; i < m; i++){
			int left = aind;
			while(aind < n && A[aind] != B[i]){
				aind++;
			}
			if(aind >= n){
				System.out.println(-1);
				return;
			}
			long temp = solve(left, aind, x, k ,y, A);
			if(temp == -1){
				System.out.println(-1);
				return;
			}
			ans += temp;
			aind++;
		}
		long temp = solve(aind, n, x, k, y, A);
		if(temp == -1){ System.out.println(-1); return;}
		ans += temp;
		pw.println(ans);
		pw.close();

	}

	static long solve(int l, int r, long x, long k, long y, int[] A){
		if(l == r) { return 0;}
		int maxp = max(l-1 >= 0 ? A[l-1] : 0, r < A.length ? A[r] : 0);
		boolean flag = false;

		for(int i = l ;i < r; i++){
			if(A[i] > maxp){
				flag = true;
				break;
			}
		}
		long ans = Long.MAX_VALUE;
		if(!flag){
			ans = min(ans, (r-l)*y);
		}
		if(r-l >= k){
			ans = min(ans, ((r-l)/k)*x + ((r-l)%k)*y);
			ans = min(ans, x + (r-l-k)*y);
		}else if(flag){
			return -1;
		}

		return ans;
	}

	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();

			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}

				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String stock = "";
			try {
				stock = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return stock;
		}

		public int nextInt() {
			int c = read();

			while (isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-') {
				sgn = -1;
				c = read();
			}

			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public double nextDouble() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') {
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) {
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return readString();
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}


import java.io.*;
import java.util.*;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class Ans implements Runnable {

	public static void main(String args[]) throws Exception {
		Ans s = new Ans();
		s.run();

	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	InputReader sc = new InputReader(System.in);
	PrintWriter pw = new PrintWriter(System.out);

	public void run() {

		int n = sc.nextInt();
		int m = sc.nextInt();
		long x = sc.nextLong();
		long k = sc.nextLong();
		long y = sc.nextLong();
		int[] A = new int[n];
		int[] B = new int[m+1];
		B[m] = (int)(1e9+8);
		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		for (int i = 0; i < m; i++) {
			B[i] = sc.nextInt();
		}
		int aind = 0;
		long ans = 0;
		for(int i = 0 ; i < m; i++){
			int left = aind;
			while(aind < n && A[aind] != B[i]){
				aind++;
			}
			if(aind >= n){
				System.out.println(-1);
				return;
			}
			long temp = solve(left, aind, x, k ,y, A);
			if(temp == -1){
				System.out.println(-1);
				return;
			}
			ans += temp;
			aind++;
		}
		long temp = solve(aind, n, x, k, y, A);
		if(temp == -1){ pw.println(-1); return;}
		ans += temp;
		pw.println(ans);
		pw.close();

	}

	static long solve(int l, int r, long x, long k, long y, int[] A){
		if(l == r) { return 0;}
		int maxp = max(l-1 >= 0 ? A[l-1] : 0, r < A.length ? A[r] : 0);
		boolean flag = false;

		for(int i = l ;i < r; i++){
			if(A[i] > maxp){
				flag = true;
				break;
			}
		}
		long ans = Long.MAX_VALUE;
		if(!flag){
			ans = min(ans, (r-l)*y);
		}
		if(r-l >= k){
			ans = min(ans, ((r-l)/k)*x + ((r-l)%k)*y);
			ans = min(ans, x + (r-l-k)*y);
		}else if(flag){
			return -1;
		}

		return ans;
	}

	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();

			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}

				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String stock = "";
			try {
				stock = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return stock;
		}

		public int nextInt() {
			int c = read();

			while (isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-') {
				sgn = -1;
				c = read();
			}

			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public double nextDouble() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') {
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) {
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return readString();
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}


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

public class CFD {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    private static long MOD = 1000L * 1000L * 1000L + 7;
    private static final int[] dx = {0, -1, 0, 1};
    private static final int[] dy = {1, 0, -1, 0};
    private static final String yes = "Yes";
    private static final String no = "No";

    void solve() throws IOException {
        int T = 1;
        for (int i = 0; i < T; i++) {
            helper();
        }
    }

    int n;
    int m;
    long x;
    long k;
    long y;
    int[] a;
    int[] b;
    void helper() throws IOException {
        n = nextInt();
        m = nextInt();
        x = nextInt();
        k = nextInt();
        y = nextInt();
        a = nextIntArr(n);
        b = nextIntArr(m);
        boolean[] match = new boolean[n];
        int start = 0;
        for (int i = 0; i < n; i++) {
            if (start >= m) {
                break;
            }
            if (a[i] == b[start]) {
                match[i] = true;
                start++;
            }
        }

        if (start < m) {
            outln(-1);
            return;
        }
        List<Integer> points = new ArrayList<>();
        points.add(-1);
        for (int i = 0; i < n; i++) {
            if (match[i]) {
                points.add(i);
            }
        }
        points.add(n);
        long res = 0;
        for (int i = 0; i < points.size() - 1; i++) {
            start = points.get(i);
            int end = points.get(i + 1);
            int v1 = start >= 0 && start < n ? a[start] : -1;
            int v2 = end >= 0 && end < n ? a[end] : -1;
            long v = find(start + 1, end - 1, Math.max(v1, v2));
            if (v == Long.MAX_VALUE) {
                outln(-1);
                return;
            }

            res += v;
        }
        outln(res);
    }

    long find(int start, int end, int limit) {
        if (end < start) {
            return 0;
        }
        long res = Long.MAX_VALUE;
        int len = end - start + 1;
        int max = -1;
        for (int i = start; i <= end; i++) {
            max = Math.max(max, a[i]);
        }

        int END = max < limit ? len : len - 1;
        for (int cy = 0; cy <= END; cy++) {
            int left = len - cy;
            if (left % k == 0) {
                res = Math.min(res, 1L * cy * y + left / k * x);
            }
        }
        return res;
    }

    void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }
    long gcd(long a, long b) {
        while(a != 0 && b != 0) {
            long c = b;
            b = a % b;
            a = c;
        }
        return a + b;
    }
    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    private void formatPrint(double val) {
        outln(String.format("%.9f%n", val));
    }
    public CFD() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new CFD();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.*;
public class edu91
{
	static long k;
	static long ans; 	static long x;	static long y;
	static int count;
	public static void main (String[] args)
	 {
		Scanner sc=new Scanner(System.in);
		int t,i;
		t=1;
		while(t>0)
		{
			t--;
			int n= sc.nextInt(); int m= sc.nextInt();
			x=sc.nextLong();	k=sc.nextLong();	y=sc.nextLong();
			long a[]=new long[n];
			long b[]=new long[m];
			for(i=0;i<n;i++)
				a[i]=sc.nextLong();
			for(i=0;i<m;i++)
				b[i]=sc.nextLong();
			if(m>n)
			{
				System.out.println(-1);
				continue;
			}
			i=0;
			int ic=0;
			boolean big=false;
			while(a[i]!=b[0])
			{
				if(a[i]>b[0])
					big=true;
				ic++;
				i++;
			}
			if(ic<k&&big==true)
			{
				System.out.println(-1);
				continue;
			}
			else
				check(big,ic,b[0]);
			for(int j=0;j<m-1;j++)
			{
				big = false;
				ic=0;
				long max= Math.max(b[j], b[j+1]);
				i++;
				while(i<n&&a[i]!=b[j+1])
				{
					if(a[i]>b[j+1])
						big=true;
					ic++;
					i++;
				}
				if(i>=n)
					break;
				if(ic<k&&big==true)
				{
					System.out.println(-1);
					return;
				}
				else
					check(big,ic,max);
			}
			if(count<m)
			{
				System.out.println(-1);
				return;
			}
			big=false; ic=0;
			i++;
			while(i<n&&a[i]!=b[m-1])
			{
				if(a[i]>b[m-1])
					big=true;
				ic++;
				i++;
			}
			if(ic<k&&big==true)
			{
				System.out.println(-1);
				continue;
			}
			else
				check(big,ic,b[0]);
			if(count<m)
			{
				System.out.println(-1);
				return;
			}
			System.out.println(ans);
		}
	}
	static void check(boolean big,int ic,long max)
	{
		count++;
		long bmin=0;
		long fmin=0;
		if(ic>=k)
		{
			fmin = (ic/k)*x + (ic%k)*y;
			if(big)
				bmin = (ic-k)*y +x;
			else
				bmin = ic*y;
			ans+= Math.min(fmin, bmin);
		}
		else
			ans += ic*y;
	}
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.*;
public class edu91
{
	static long k;		static long ans;
	static long x;	static long y;  	static int count;
	public static void main (String[] args)
	 {
		Scanner sc=new Scanner(System.in);
		int t,i;
		t=1;
		while(t>0)
		{
			t--;
			int n= sc.nextInt(); int m= sc.nextInt();
			x=sc.nextLong();	k=sc.nextLong();	y=sc.nextLong();
			long a[]=new long[n]; long b[]=new long[m];
			for(i=0;i<n;i++)
				a[i]=sc.nextLong();
			for(i=0;i<m;i++)
				b[i]=sc.nextLong();
			if(m>n)
			{
				System.out.println(-1);
				continue;
			}
			HashMap<Long,Integer> h=new HashMap();
			for(i=0;i<n;i++)
				h.put(a[i], 0);
			for(i=0;i<m;i++)
			{
				if(h.get(b[i])==null)
				{
					System.out.println(-1);
					return;
				}
			}
			i=0;	int ic=0;
			boolean big=false;
			while(a[i]!=b[0])
			{
				if(a[i]>b[0])
					big=true;
				ic++;
				i++;
			}
			if(ic<k&&big==true)
			{
				System.out.println(-1);
				continue;
			}
			else
				check(big,ic);
			for(int j=0;j<m-1;j++)
			{
				big = false;
				ic=0;
				long max= Math.max(b[j], b[j+1]);
				i++;
				while(i<n&&a[i]!=b[j+1])
				{
					if(a[i]>b[j+1])
						big=true;
					ic++;
					i++;
				}
				if(i>=n)
					break;
				if(ic<k&&big==true)
				{
					System.out.println(-1);
					return;
				}
				else
					check(big,ic);
			}
			big=false; ic=0;  i++;
			while(i<n)
			{
				if(a[i]>b[m-1])
					big=true;
				ic++;
				i++;
			}
			if(ic<k&&big==true)
			{
				System.out.println(-1);
				continue;
			}
			else
				check(big,ic);
			if(count<m)
			{
				System.out.println(-1);
				return;
			}
			System.out.println(ans);
		}
	}
	static void check(boolean big,int ic)
	{
		count++;
		long bmin=0;   long fmin=0;
		if(ic>=k)
		{
			fmin = (ic/k)*x + (ic%k)*y;
			if(big)
				bmin = (ic-k)*y +x;
			else
				bmin = ic*y;
			ans+= Math.min(fmin, bmin);
		}
		else
			ans += ic*y;
	}
}


	import java.util.ArrayList;
	import java.util.Arrays;
	import java.util.*;
	public class edu91
	{
		static long k;		static long ans;
		static long x;	static long y;  	static int count;
		public static void main (String[] args)
		 {
			Scanner sc=new Scanner(System.in);
			int t,i;
			t=1;
			while(t>0)
			{
				t--;
				int n= sc.nextInt(); int m= sc.nextInt();
				x=sc.nextLong();	k=sc.nextLong();	y=sc.nextLong();
				long a[]=new long[n]; long b[]=new long[m];
				for(i=0;i<n;i++)
					a[i]=sc.nextLong();
				for(i=0;i<m;i++)
					b[i]=sc.nextLong();
				if(m>n)
				{
					System.out.println(-1);
					continue;
				}
				HashMap<Long,Integer> h=new HashMap();
				for(i=0;i<n;i++)
					h.put(a[i], 0);
				for(i=0;i<m;i++)
				{
					if(h.get(b[i])==null)
					{
						System.out.println(-1);
						return;
					}
				}
				i=0;	int ic=0;
				boolean big=false;
				while(a[i]!=b[0])
				{
					if(a[i]>b[0])
						big=true;
					ic++;
					i++;
				}
				if(ic<k&&big==true)
				{
					System.out.println(-1);
					continue;
				}
				else
					check(big,ic);
				for(int j=0;j<m-1;j++)
				{
					big = false;
					ic=0;
					long max= Math.max(b[j], b[j+1]);
					i++;
					while(i<n&&a[i]!=b[j+1])
					{
						if(a[i]>max)
							big=true;
						ic++;
						i++;
					}
					if(i>=n)
						break;
					if(ic<k&&big==true)
					{
						System.out.println(-1);
						return;
					}
					else
						check(big,ic);
				}
				big=false; ic=0;
				i++;
				while(i<n)
				{
					if(a[i]>b[m-1])
						big=true;
					ic++;
					i++;
				}
				if(ic<k&&big==true)
				{
					System.out.println(-1);
					continue;
				}
				else
					check(big,ic);
				if(count<=m)
				{
					System.out.println(-1);
					return;
				}
				System.out.println(ans);
			}
		}
		static void check(boolean big,int ic)
		{
			count++;
			long bmin=0;   long fmin=0;
			if(ic>=k)
			{
				fmin = (ic/k)*x + (ic%k)*y;
				if(big)
					bmin = (ic-k)*y +x;
				else
					bmin = ic*y;
				ans+= Math.min(fmin, bmin);
			}
			else
				ans += ic*y;
		}
	}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.*;
public class edu91
{
	static long k;		static long ans;
	static long x;	static long y;  	static int count;
	public static void main (String[] args)
	 {
		Scanner sc=new Scanner(System.in);
		int t,i;
		t=1;
		while(t>0)
		{
			t--;
			int n= sc.nextInt(); int m= sc.nextInt();
			x=sc.nextLong();	k=sc.nextLong();	y=sc.nextLong();
			long a[]=new long[n]; long b[]=new long[m];
			for(i=0;i<n;i++)
				a[i]=sc.nextLong();
			for(i=0;i<m;i++)
				b[i]=sc.nextLong();
			if(m>n)
			{
				System.out.println(-1);
				continue;
			}
			HashMap<Long,Integer> h=new HashMap();
			for(i=0;i<n;i++)
				h.put(a[i], 0);
			for(i=0;i<m;i++)
			{
				if(h.get(b[i])==null)
				{
					System.out.println(-1);
					return;
				}
			}
			i=0;	int ic=0;
			boolean big=false;
			while(a[i]!=b[0])
			{
				if(a[i]>b[0])
					big=true;
				ic++;
				i++;
			}
			if(ic<k&&big==true)
			{
				System.out.println(-1);
				continue;
			}
			else
				check(big,ic);
			for(int j=0;j<m-1;j++)
			{
				big = false;
				ic=0;
				long max= Math.max(b[j], b[j+1]);
				i++;
				while(i<n&&a[i]!=b[j+1])
				{
					if(a[i]>b[j+1])
						big=true;
					ic++;
					i++;
				}
				if(i>=n)
					break;
				if(ic<k&&big==true)
				{
					System.out.println(-1);
					return;
				}
				else
					check(big,ic);
			}
			big=false; ic=0;
			i++;
			while(i<n)
			{
				if(a[i]>b[m-1])
					big=true;
				ic++;
				i++;
			}
			if(ic<k&&big==true)
			{
				System.out.println(-1);
				continue;
			}
			else
				check(big,ic);
			if(count<=m)
			{
				System.out.println(-1);
				return;
			}
			System.out.println(ans);
		}
	}
	static void check(boolean big,int ic)
	{
		count++;
		long bmin=0;   long fmin=0;
		if(ic>=k)
		{
			fmin = (ic/k)*x + (ic%k)*y;
			if(big)
				bmin = (ic-k)*y +x;
			else
				bmin = ic*y;
			ans+= Math.min(fmin, bmin);
		}
		else
			ans += ic*y;
	}
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.*;
public class edu91
{
	static long k;		static long ans;
	static long x;	static long y;  	static int count;
	public static void main (String[] args)
	 {
		Scanner sc=new Scanner(System.in);
		int t,i;
		t=1;
		while(t>0)
		{
			t--;
			int n= sc.nextInt(); int m= sc.nextInt();
			x=sc.nextLong();	k=sc.nextLong();	y=sc.nextLong();
			long a[]=new long[n]; long b[]=new long[m];
			for(i=0;i<n;i++)
				a[i]=sc.nextLong();
			for(i=0;i<m;i++)
				b[i]=sc.nextLong();
			if(m>n)
			{
				System.out.println(-1);
				continue;
			}
			i=0;	int ic=0;
			boolean big=false;
			while(a[i]!=b[0])
			{
				if(a[i]>b[0])
					big=true;
				ic++;
				i++;
			}
			if(ic<k&&big==true)
			{
				System.out.println(-1);
				continue;
			}
			else
				check(big,ic);
			for(int j=0;j<m-1;j++)
			{
				big = false;
				ic=0;
				long max= Math.max(b[j], b[j+1]);
				i++;
				while(i<n&&a[i]!=b[j+1])
				{
					if(a[i]>b[j+1])
						big=true;
					ic++;
					i++;
				}
				if(i>=n)
					break;
				if(ic<k&&big==true)
				{
					System.out.println(-1);
					return;
				}
				else
					check(big,ic);
			}
			big=false; ic=0;  i++;
			while(i<n)
			{
				if(a[i]>b[m-1])
					big=true;
				ic++;
				i++;
			}
			if(ic<k&&big==true)
			{
				System.out.println(-1);
				continue;
			}
			else
				check(big,ic);
			if(count<m)
			{
				System.out.println(-1);
				return;
			}
			System.out.println(ans);
		}
	}
	static void check(boolean big,int ic)
	{
		count++;
		long bmin=0;
		long fmin=0;
		if(ic>=k)
		{
			fmin = (ic/k)*x + (ic%k)*y;
			if(big)
				bmin = (ic-k)*y +x;
			else
				bmin = ic*y;
			ans+= Math.min(fmin, bmin);
		}
		else
			ans += ic*y;
	}
}


#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#include <list>
using namespace std;

int n;
list<int> s;

int getint(){
    int r=0;
	char c;
	c=getchar();
    while(c<'0'||c>'9') c=getchar();
    while(c>='0'&&c<='9'){r=r*10+c-'0';c=getchar();}
    return r;
}

long long num[100];

void printint(long long x){
	long long cntt=0;
	while(x!=0){
        num[++cntt]=x%10;
        x/=10;
    }
    for(long long ii=cntt;ii>=1;ii--) putchar(num[ii]+'0');
}

signed main()
{
	cin>>n;
	long long pre=0;
	bool flag=false;
	for(int i=1;i<=n;i++){
		char c1,c2,c3;
		char c;
		c=getchar();
		while(c<'a'||c>'z') c=getchar();
		c1=c;
		c2=getchar();
		c3=getchar();
		if(c1=='a'){
			int k=getint();
			s.insert(lower_bound(s.begin(),s.end(),k),k);
			flag=false;
		}
		else if(c1=='d'){
			int k=getint();
			s.erase(lower_bound(s.begin(),s.end(),k));
			flag=false;
		}
		else{
			if(flag==true){
				cout<<pre<<endl;
				continue;
			}
			long long sum=0;
			list<int>::iterator it;
			int cnt=0;
			for(it=s.begin();it!=s.end();it++,cnt++){if(cnt%5==2) sum+=(long long)*it;}
			pre=sum;
			printint(sum);
			puts("");
			flag=true;
		}
	}
	return 0;
}


#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;

int n;
vector<int> s;

signed main()
{
	ios::sync_with_stdio(false);
	cin>>n;
	for(int i=1;i<=n;i++){
		char c1,c2,c3;
		int k;
		cin>>c1>>c2>>c3;
		if(c1=='a'){
			cin>>k;
			s.insert(lower_bound(s.begin(),s.end(),k),k);
		}
		else if(c1=='d'){
			cin>>k;
			s.erase(lower_bound(s.begin(),s.end(),k));
		}
		else{
			long long sum=0;
			for(int i=2;i<s.size();i+=5) sum+=(long long)s[i];
			cout<<sum<<endl;
		}
	}
	return 0;
}


//In the name of ALLAH
//Sum of Medians - 85D

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long llint;
#define err(x) cout << #x << " : " << x << '\n';

const int N = 100010, L = 320;

llint sum[L<<2][5];
int m;
vector<int> vec[L<<2];

inline void upd(int& t){
	for (int i=0;i<5;i++) sum[t][i] = 0;
	for (int i=0;i<(int)vec[t].size();i++)
		sum[t][i % 5] += (llint)vec[t][i];
}

vector<int> tmp;
inline void relax(void){
	tmp.resize(0);
	for (int i=0;i<m;i++)
		for (int j=0;j<(int)vec[i].size();j++)
			tmp.push_back(vec[i][j]);
	m = 0;
	for (int i=0;i<(int)tmp.size();i++){
		vec[m].push_back(tmp[i]);
		if ((int)vec[m].size() >= L)
			++m;
	}
	m++;
	for (int i=0;i<m;i++)
		upd(i);
}

int main(){
	int n;
	scanf("%d",&n);

	char cmd[20];
	int x, idx, ndel = 0, sz;
	llint ans;

	while (n--){
		scanf("%s",cmd);

		if (*cmd == 's'){
			sz = 0;
			ans = 0;
			for (int i=0;i<m;i++){
				ans += sum[i][(2 - (sz % 5) + 5)%5];
				sz += (int)vec[i].size();
			}
			printf("%I64d\n", ans);
		}
		else if (*cmd == 'a'){
			scanf("%d",&x);
			idx = 0;
			while (idx < m - 1 && vec[idx].back() < x)
				idx++;
			vec[idx].push_back(x);
			m= max(m, idx + 1);
			int j = (int)vec[idx].size() - 1;
			while (j && vec[idx][j] < vec[idx][j-1]){
				swap(vec[idx][j], vec[idx][j-1]);
				j--;
			}
			if ((int)vec[idx].size() >= 2 * L)
				relax();
			upd(idx);
		}
		else{
			++ndel;
			scanf("%d",&x);
			int i = 0;
			while (vec[i].back() < x)
				i++;
			//err(i);
			vec[i].erase(find(vec[i].begin(), vec[i].end(), x));
			upd(i);
			if (ndel >= 2 * L)
				relax();
		}
	}

	return 0;
}


//In the name of ALLAH
//Sum of Medians - 85D

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long llint;
#define err(x) cout << #x << " : " << x << '\n';

const int N = 100010, L = 320;

llint sum[L<<3][10];
int m, ndel;
vector<int> vec[L<<3];

inline void upd(int& t){
	for (int i=0;i<5;i++) sum[t][i] = 0;
	for (int i=0;i<(int)vec[t].size();i++)
		sum[t][i % 5] += (llint)vec[t][i];
}

vector<int> tmp;
inline void relax(void){
	ndel = 0;
	tmp.resize(0);
	for (int i=0;i<m;i++){
		for (int j=0;j<(int)vec[i].size();j++)
			tmp.push_back(vec[i][j]);
		vec[i].resize(0);
	}
	m = 0;
	for (int i=0;i<(int)tmp.size();i++){
		vec[m].push_back(tmp[i]);
		if ((int)vec[m].size() >= L)
			++m;
	}
	m++;
	for (int i=0;i<m;i++)
		upd(i);
}

int main(){
	int n;
	scanf("%d",&n);

	char cmd[20];
	int x, idx, sz;
	llint ans;

	while (n--){
		scanf("%s",cmd);

		if (*cmd == 's'){
			sz = 0;
			ans = 0;
			for (int i=0;i<m;i++){
				ans += sum[i][(2 - (sz % 5) + 5)%5];
				sz += (int)vec[i].size();
			}
			printf("%I64d\n", ans);
		}
		else if (*cmd == 'a'){
			scanf("%d",&x);
			idx = 0;
			while (idx < m - 1 && vec[idx].back() < x)
				idx++;
			vec[idx].push_back(x);
			m = max(m, idx + 1);
			int j = (int)vec[idx].size() - 1;
			while (j && vec[idx][j] < vec[idx][j-1]){
				swap(vec[idx][j], vec[idx][j-1]);
				j--;
			}
			if ((int)vec[idx].size() >= 2 * L)
				relax();
			upd(idx);
		}
		else{
			++ndel;
			scanf("%d",&x);
			int i = 0;
			while (vec[i].back() < x)
				++i;
			vec[i].erase(find(vec[i].begin(), vec[i].end(), x));
			if (vec[i].size() == 0 && i < m-1)
				relax();
			else upd(i);
		}
	}

	return 0;
}


//In the name of ALLAH
//Sum of Medians - 85D

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long llint;
#define err(x) cout << #x << " : " << x << '\n';

const int N = 100010, L = 320;

llint sum[L<<3][5];
int m = L, ndel;
vector<int> vec[L<<3];

inline void upd(int& t){
	for (int i=0;i<5;i++) sum[t][i] = 0;
	for (int i=0;i<(int)vec[t].size();i++)
		sum[t][i % 5] += (llint)vec[t][i];
}

vector<int> tmp;
inline void relax(void){
	ndel = 0;
	tmp.resize(0);
	for (int i=0;i<m;i++)
		for (int j=0;j<(int)vec[i].size();j++)
			tmp.push_back(vec[i][j]);
	m = 0;
	for (int i=0;i<(int)tmp.size();i++){
		vec[m].push_back(tmp[i]);
		if ((int)vec[m].size() >= L)
			++m;
	}
	m++;
	for (int i=0;i<m;i++)
		upd(i);
}

int main(){
	int n;
	scanf("%d",&n);

	char cmd[20];
	int x, idx, sz;
	llint ans;

	while (n--){
		scanf("%s",cmd);

		if (*cmd == 's'){
			sz = 0;
			ans = 0;
			for (int i=0;i<m;i++){
				ans += sum[i][(2 - (sz % 5) + 5)%5];
				sz += (int)vec[i].size();
			}
			printf("%I64d\n", ans);
		}
		else if (*cmd == 'a'){
			scanf("%d",&x);
			idx = 0;
			while (idx < m - 1 && vec[idx].back() < x)
				idx++;
			vec[idx].push_back(x);
			int j = (int)vec[idx].size() - 1;
			while (j && vec[idx][j] < vec[idx][j-1]){
				swap(vec[idx][j], vec[idx][j-1]);
				j--;
			}
			if ((int)vec[idx].size() >= 2 * L)
				relax();
			upd(idx);
		}
		else{
			++ndel;
			scanf("%d",&x);
			int i = 0;
			while (vec[i].back() < x)
				i++;
			//err(i);
			vec[i].erase(find(vec[i].begin(), vec[i].end(), x));
			upd(i);
			if (ndel >= 2 * L)
				relax();
		}
	}

	return 0;
}


//In the name of ALLAH
//Sum of Medians - 85D

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long llint;
#define err(x) cout << #x << " : " << x << '\n';

const int N = 100010, L = 320;

llint sum[L][5];
int m;
vector<int> vec[L];

inline void upd(int& t){
	for (int i=0;i<5;i++) sum[t][i] = 0;
	for (int i=0;i<(int)vec[t].size();i++)
		sum[t][i % 5] += vec[t][i];
}

vector<int> tmp;
inline void relax(void){
	tmp.resize(0);
	for (int i=0;i<m;i++)
		for (int j=0;j<(int)vec[i].size();j++)
			tmp.push_back(vec[i][j]);
	m = 0;
	for (int i=0;i<(int)tmp.size();i++){
		vec[m].push_back(tmp[i]);
		if ((int)vec[m].size() >= L)
			++m;
	}
	m++;
	for (int i=0;i<m;i++)
		upd(i);
}

int main(){
	int n;
	scanf("%d",&n);

	char cmd[20];
	int x, idx, ndel = 0, sz;
	llint ans;

	while (n--){
		scanf("%s",cmd);

		if (*cmd == 's'){
			sz = 0;
			ans = 0;
			for (int i=0;i<m;i++){
				ans += sum[i][(2 - (sz % 5) + 5)%5];
				sz += (int)vec[i].size();
			}
			printf("%I64d\n", ans);
		}
		else if (*cmd == 'a'){
			scanf("%d",&x);
			idx = 0;
			while (idx < m - 1 && vec[idx].back() < x)
				idx++;
			vec[idx].push_back(x);
			m= max(m, idx + 1);
			int j = (int)vec[idx].size() - 1;
			while (j && vec[idx][j] < vec[idx][j-1]){
				swap(vec[idx][j], vec[idx][j-1]);
				j--;
			}
			if ((int)vec[idx].size() >= 2 * L)
				relax();
			upd(idx);
		}
		else{
			++ndel;
			scanf("%d",&x);
			int i = 0;
			while (vec[i].back() < x)
				i++;
			//err(i);
			vec[i].erase(find(vec[i].begin(), vec[i].end(), x));
			upd(i);
			if (ndel >= 2 * L)
				relax();
		}
	}

	return 0;
}


//In the name of ALLAH
//Sum of Medians - 85D

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long llint;
#define err(x) cout << #x << " : " << x << '\n';

const int N = 100010, L = 320;

llint sum[L<<1][5];
int m;
vector<int> vec[L<<1];

inline void upd(int& t){
	for (int i=0;i<5;i++) sum[t][i] = 0;
	for (int i=0;i<(int)vec[t].size();i++)
		sum[t][i % 5] += (llint)vec[t][i];
}

vector<int> tmp;
inline void relax(void){
	tmp.resize(0);
	for (int i=0;i<m;i++)
		for (int j=0;j<(int)vec[i].size();j++)
			tmp.push_back(vec[i][j]);
	m = 0;
	for (int i=0;i<(int)tmp.size();i++){
		vec[m].push_back(tmp[i]);
		if ((int)vec[m].size() >= L)
			++m;
	}
	m++;
	for (int i=0;i<m;i++)
		upd(i);
}

int main(){
	int n;
	scanf("%d",&n);

	char cmd[20];
	int x, idx, ndel = 0, sz;
	llint ans;

	while (n--){
		scanf("%s",cmd);

		if (*cmd == 's'){
			sz = 0;
			ans = 0;
			for (int i=0;i<m;i++){
				ans += sum[i][(2 - (sz % 5) + 5)%5];
				sz += (int)vec[i].size();
			}
			printf("%I64d\n", ans);
		}
		else if (*cmd == 'a'){
			scanf("%d",&x);
			idx = 0;
			while (idx < m - 1 && vec[idx].back() < x)
				idx++;
			vec[idx].push_back(x);
			m= max(m, idx + 1);
			int j = (int)vec[idx].size() - 1;
			while (j && vec[idx][j] < vec[idx][j-1]){
				swap(vec[idx][j], vec[idx][j-1]);
				j--;
			}
			if ((int)vec[idx].size() >= 2 * L)
				relax();
			upd(idx);
		}
		else{
			++ndel;
			scanf("%d",&x);
			int i = 0;
			while (vec[i].back() < x)
				i++;
			//err(i);
			vec[i].erase(find(vec[i].begin(), vec[i].end(), x));
			upd(i);
			if (ndel >= 2 * L)
				relax();
		}
	}

	return 0;
}