In general the total equilibrium concentration of any acid HA is
$$c_a=\mathrm{[HA]_e+[H^+]_e - [OH^-]_e}\tag{1a}$$
and for a base
$$c_b=\mathrm{[B]_e -[H^+]_e + [OH^-]_e\tag{1b}}$$
When there is a strong acid and base the pH is not always what is expected due to the equilibrium $\mathrm{H_2O \leftrightharpoons H^+ + OH^-}$. This is particularly the case around pH = 7. To calculate the pH of a strong base start with eqn 1(a) but for the strong base the equilibrium amount of base $\mathrm{[B]_e}=0$ and so the equation to solve is
$$c_b=\mathrm{ -[H^+]} + K_w/\mathrm{[H^+]}$$
where $K_w=\mathrm{[H^+][OH^-]} = 10^{-14}$. This equation is, letting $x =\mathrm{[H^+]}$, $x^2+c_bx-K_w=0$ and solving for a concentration of, for example, $5\cdot 10^{-8}$ M produces $\mathrm{[H^+]}=7.8\cdot 10^{-8}$ or pH = 7.11.
In the case of a strong acid [HA] = 0 and equation (1a) solved but once the $\mathrm{[OH^-]}$ is known $K_w$ can be used to find $\mathrm{[H^+]}$
The figure shows the pH, for example, of a KOH solution at a range of concentrations. Around 10-7 molar the pH is greater than that anticipated. In a strong acid the pH is smaller than anticipated (more acidic) around this concentration.

Figure. The pH of a strong acidic and strong basic solution (e.g. KOH ) at a range of concentrations.