Mālin is genitive in «كَمْ مَالٍ أَنْفَقْتَهُ».

Al-Kināyāt — Kam, its Tamyīz and Syntactic Positions