#include using namespace std; int main(){ int n; vector a(3),b; cin>>a[0]>>a[1]>>a[2]>>n; b.resize(n); for(auto &&v:b)cin>>v; sort(a.begin(),a.end()); sort(b.begin(),b.end()); long dp[n+1][4]={}; dp[0][0]=1; for(int i=0;i=a[j])]+=dp[i][j]; dp[i+1][j]+=dp[i][j]; } dp[i+1][3]+=2*dp[i][3]; } cout<