calc_chunk_size function

calculate the full chunk size