@Akhilesh ,
I have given the link of University of Texas where it is mentioned that :-
We often speak of "extra" memory needed, not counting the memory needed to store the input itself.
So, we should not have to consider the input size to find the space complexity of an algorithm.
@Akash ,it should be O(n) which you have already mentioned because we have to store frequencies of characters from the input file seperately in the array.