include [HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
int main()
{
int n;
scanf(“%d”,&n);
int a[n],b[n],c[n];
for(int i=0;i<n;i)
scanf(“%d”,&a[i]);
for(int i=0;i<n;i)
scanf(“%d”,&b[i]);
for(int i=0;i<n;i)
scanf(“%d”,&c[i]);
sort(a,a+n);
sort(b,b+n);
sort(c,c+n);
long long int res=0;
long long int x,y;
for(int i=0;i<n;i)
{
x=lower_bound(a,a+n,b[i])-a;
y=n-(upper_bound(c,c+n,b[i])-c);
res=res+x*y;
}
printf(“%lld”,res);
return 0;
}