Problem: You have 4 bags A, B, C and D each of which includes N coins (there are totally 4N coins). Values of the coins in each bag are ai, bi, ci and di respectively.

Find the number of combinations that result when you choose one coin from each bag (totally 4 coins) in such a way that the total value of the coins is V. You should distinguish the coins in a bag.

Constraints

* 1 ≤ N ≤ 1000
* 1 ≤ ai, bi, ci, di ≤ 1016
* 1 ≤ V ≤ 1016
* All input values are given in integers

Input

The input is given in the following format.


N V
a1 a2 ... aN
b1 b2 ... bN
c1 c2 ... cN
d1 d2 ... dN


Output

Print the number of combinations in a line.

Examples

Input

3 14
3 1 2
4 8 2
1 2 3
7 3 2


Output

9


Input

5 4
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1


Output

625

Solution (in CPP):

Solution:
// ?????¬???????????¬??????

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

typedef pair<int, int> pii;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

int N, V;
int a[1010], b[1010], c[1010], d[1010];

signed main() {
    cin >> N >> V;
    rep(i,0,N) cin >> a[i];
    rep(i,0,N) cin >> b[i];
    rep(i,0,N) cin >> c[i];
    rep(i,0,N) cin >> d[i];

    vector<int> va, vb;
    rep(i,0,N) rep(j,0,N) va.push_back(a[i] + b[j]);
    rep(i,0,N) rep(j,0,N) vb.push_back(c[i] + d[j]);

    sort(va.begin(), va.end());
    sort(vb.begin(), vb.end());

    int S = va.size(), T = vb.size();
    int cur = 0, ans = 0;
    rep(i,0,S) {
        int ub = upper_bound(vb.begin(), vb.end(), V-va[i]) - vb.begin();
        int lb = lower_bound(vb.begin(), vb.end(), V-va[i]) - vb.begin();
        ans += (ub - lb);
    }
    cout << ans << endl;
    return 0;
}