Problem: A boy PCK had N straight iron bars, which were serially indexed. Unfortunately, the first M bars (0 ≤ M ≤ N) among them were bent during transportation. They all suffered a perpendicular bend at one point.

He is planning to make a cube using a set of bars selected using the following rules: X bars from bent ones, Y bars from straight ones, where 2X + Y = 12. Any two bars can be jointed only at the apexes of the cube. He wants to count how many types of rectangular parallelepipeds (hereafter RP) he can make using these bars.

Make a program to count out types (different shapes) of RPs that PCK can make using the following information: the number of bars and length of each one, position of the bend, and the number of bars to be used to construct an RP. Note that any two RPs similar in shape are considered identical: namely if the length of three defining sides of two RPs coincide if arranged in increasing/decreasing order (e.g., three sides of RP i and j are A_i, B_i, C_i, and A_j, B_j and C_j in increasing order, then the relations A_i = A_j, B_i = B_j, and C_i = C_j hold. Note also that the bars are sufficiently thin to allow you to consider them as idealized lines.



Input

The input is given in the following format.


N M X Y
a_1
a_2
:
a_N
b_1
b_2
:
b_M


The first line provides the total number of iron bars and bent bars, and those straight and bent bars used to construct an RP: N (6 ≤ N ≤ 6000), M (0 ≤ M ≤ N), X (0 ≤ X ≤ 6), and Y (0 ≤ Y ≤ 12). The following relations always hold for them: 2X+Y=12, X+Y ≤ N, X ≤ M. Each of the subsequent N lines provides the length of the i-th bar a_i (1 ≤ a_i ≤ 6000) in integers. Furthermore, each of the subsequent M lines provides the location at which the i-th bent bar suffered a perpendicular bend b_i (1 ≤ b_i ≤ 3000) in centimeters from one end of the bar (note: 1 ≤ a_i-b_i ≤ 3000).

Output

Output the number of constructible rectangular parallelepipeds.

Example

Input

18 8 3 6
4
3
3
3
3
2
2
2
1
1
1
1
1
2
2
3
3
3
1
1
1
1
1
1
1
1


Output

3

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[6001][6001],b[6001];
int n,m,x,y,mn;
unordered_set<ll> st;

bool check(int A,int B,int C){
  for(int i=0;i<=min(mn,a[A][B]);i++)
    for(int j=0;i+j<=min(mn,a[B][C]+i);j++){
      int k=x-i-j;
      if(i+k>4||j+k>4||a[A][C]<k)continue;
      if(A==C&&(a[A][A]<x||b[A]<12-2*(i+j+k)))continue;
      if(A==B&&(a[A][C]<j+k||b[A]<8-(2*i+j+k)))continue;
      if(B==C&&(a[A][B]<i+k||b[B]<8-(i+2*j+k)))continue;
      if(b[A]>=4-i-k&&b[B]>=4-i-j&&b[C]>=4-j-k)return 1;
    }
  return 0;
}

int main(){
  int t[6000],v[6000];
  cin>>n>>m>>x>>y;
  for(int i=0;i<n;i++){
    cin>>t[i];
    if(i>=m)b[t[i]]++;
  }
  for(int i=0;i<m;i++){
    cin>>v[i];
    int p=t[i]-v[i];
    if(v[i]>p)swap(v[i],p);
    a[v[i]][p]++;
  }
  if(x){
    ll M=6001;
    mn=min(4,x);
    for(int i=0;i<m;i++)
      for(int j=1;j<=6000;j++){
	ll p1=v[i],p2=t[i]-v[i],p3=j;
	if(p2>p3)swap(p2,p3);
	if(p1>p2)swap(p1,p2);
	ll s=p1*M*M+p2*M+p3;
	if(!st.count(s)&&check(p1,p2,p3))st.insert(s);
      }
    cout<<st.size()<<endl;
  }
  else{
    ll c4=0,c8=0,c12=0;
    for(int i=1;i<=6000;i++){
      if(b[i]>=4)c4++;
      if(b[i]>=8)c8++;
      if(b[i]>=12)c12++;
    }
    cout<<c4*(c4-1)*(c4-2)/6+c8*(c4-1)+c12<<endl;
  }
  return 0;
}