public void solve() throws IOException {
    int[] c = new int[4];
    for (int x = 0; x < 4; x++)
      c[x] = nextInt();
    int n = nextInt();
    int m = nextInt();

    int total = 0;
    int cost = 0;
    for (int x = 0; x < n; x++) {
      int a = nextInt();
      if (a * c[0] > c[1])
        cost += c[1];
      else
        cost += a * c[0];
    }
    if (cost > c[2])
      cost = c[2];
    total += cost;
    cost = 0;
    for (int x = 0; x < m; x++) {
      int a = nextInt();
      if (a * c[0] > c[1])
        cost += c[1];
      else
        cost += a * c[0];
    }
    if (cost > c[2])
      cost = c[2];
    total += cost;
    if (total > c[3])
      total = c[3];
    System.out.println(total);
  }