module.exports=function(r){var e={};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=r,t.c=e,t.d=function(r,e,n){t.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},t.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},t.t=function(r,e){if(1&e&&(r=t(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var o in r)t.d(n,o,function(e){return r[e]}.bind(null,o));return n},t.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(e,"a",e),e},t.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},t.p="",t(t.s=0)}([function(r,e,t){t(1)(t(2).readFileSync("/dev/stdin","UTF-8").split("\n"))},function(r,e){r.exports=function(r){var e=Number(r[0]),t=r[1].split(" ").map(function(r){return Number(r)}),n=r[2].split(" ").map(function(r){return Number(r)}),o=r[3].split(" ").map(function(r){return Number(r)});t.sort(function(r,e){return r-e}),n.sort(function(r,e){return r-e});for(var u=new Array(e),f=0;f<e;f++){for(var i=-1,a=e;Math.abs(i-a)>1;){var l=Math.floor((i+a)/2);t[l]<n[f]?i=l:a=l}u[f]=i+1,f>0&&(u[f]+=u[f-1])}for(var c=0,p=0;p<e;p++){for(var s=-1,d=e;Math.abs(s-d)>1;){var b=Math.floor((s+d)/2);n[b]<o[p]?s=b:d=b}s>=0&&(c+=u[s])}console.log(c)}},function(r,e){r.exports=require("fs")}]);