The underlying formula that you want to use here for compound interest is
P = A / (1 + r/n)^(nt)
Plugging in the values that we know that becomes
P = 1000000 / (1 + 0.05/365)^(365*30)
P = 1000000 / 4.481689
P = 223,153.08
meaning that the principal amount required to meet the criteria here is approximately $223,153.08