Rank Function of a Direct Sum of Matroids