Splitting mailboxes Exchange 2019 and between O365

I am trying to cut my budget here. We have 100 mailboxes on O365 subscription (40 E3 and 60 E1) can the mailboxes be migrated to on-premise exchange 2019 in which the 60 mailboxes E1 will be migrated and the E3 mailboxes will stay on O365 and this will be to cut the cost of O365 and keep the E3 only due to low activity of users using E1.