Maternity Allowance + UC

Hi everyone, would anybody know how MA + UC works? As far as I’m aware UC will take the whole of my child element + personal allowance which equates to £544 (paying off an advance payment on top), but then it will also dip into my housing benefit. Doesn’t seem worth it? Am I best to get my back pay and then ask them to stop MA? I know I’ll owe this back to UC as I saw so much of it when working for carers allowance.