If I got it right you arrive HEL from LHR and leave for ARN/MAD, thus arriving from outside the Schengen area and leaving for a Schengen destination. This means you will have to go through immigration at HEL. However, assuming the flight from LHR is on time you should normally not have any problem making your connection. HEL is not a big airport and there is only one international terminal.