Software-Defined Networking (SDN) offers an abstract view of the network and assists network operators to control the network traffic and the associated network resources more effectively. For the past few years, SDN has shown a lot of merits in diverse fields of applications, an important one being the Wireless Body Area Network (WBAN) for healthcare services. With the amalgamation of SDN with WBAN (SDWBAN), the patient monitoring and management system has gained much more flexibility and scalability compared to the conventional WBAN. However, the performance of the SDWBAN framework largely depends on the controller which is a core element of the control plane. The reason is that an optimal number of controllers assures the satisfactory level of performance and control of the network traffic originating from the underlying data plane devices. This paper proposes a mathematical model to determine the optimal number of controllers for the SDWBAN framework in healthcare applications. To achieve this goal, the proposed mathematical model adopts the convex optimization method and incorporates three critical SDWBAN factors in the design process: number of controllers, latency and number of SDN-enabled switches (SDESW). The proposed analytical model is validated by means of simulations in Castalia 3.2 and the outcomes indicate that the network achieves high level of Packet Delivery Ratio (PDR) and low latency for optimal number of controllers as derived in the mathematical model.