Hello, Olga.
If you want to simply remove it (or at least tell Google bots that it's removed), use "410 Gone" status, not 404. For user experience, I'd redirected those subdomains to index page of domain, or, if you have time and resources, create a landing page, saying something like "Sorry for inconvenience, the content is not there anymore, use search to find whatever you need ", add a search bar of main domain content, viola!
Hope this helps.