Probably a lot more than just a few months. You underestimate how similar Indo-European languages are to each other -- and that you already have a background in English and French.
Maybe a year or two. I don't doubt you would have learned Hungarian/Finnish but it would not have been as easy as you seem to think.
In the mid 2000's, before the Big Crash, we suddenly had lots of work immigrants from Africa in Denmark. They were such a breath of fresh air in comparison to our Somalis. They actually spoke English before they came, they behaved civilized, and a lot of them managed to learn some Danish -- on their own, similarly to what you did with Swedish but without the Open University enrollment, so they did it even more on their own than you did.
That's what proper immigrants do, even if they are only here temporarily.