How to select the size of my problem?

I have to calculate a functional (it’s a set of matrix vector multiplication in double precision, three matrix and six vector) of size n (square matrix nxn and vector of size n). If i have 4800 MBytes of global memory on my gpu (it’s a K20) and i want to transfer all the data on the gpu at one time, how i choose n to fill all the gpu global memory, take into account a double is 8 bytes?