AMC 12A Spring 2021 (Problem 19)

How many solutions does the equation sin ⁣(π2cosx)=cos ⁣(π2sinx)\sin\!\Big(\tfrac{\pi}{2}\cos x\Big) = \cos\!\Big(\tfrac{\pi}{2}\sin x\Big) have in the closed interval [0,π][0,\pi]?
(A)  0\text{(A)}\;0(B)  1\text{(B)}\;1(C)  2\text{(C)}\;2(D)  3\text{(D)}\;3(E)  4\text{(E)}\;4