If it's leasehold, then your adverse possession only runs against the lessee and not the lessor (i.e. if you squat, you extinguish the rights of the guy who is leasing the property, and the rights of the guy to whom the property reverts at the end of the lease - whether it is 50 years or 1000 years are not affected. Furthermore, sometimes the lessor is able to step in and end a lease early so despite the fact that the lease should run on for another 800 years or whatever, and the squatter should be entitled to adverse possession for that time, in fact the squatter may not ejected at any stage.
A slightly anomalous area of Property Law - you'll probably find papers on it if you look in Law Libraries.
EDIT:
Oops, - just saw that but about buying the freehold - yep you could do that - if it's possible and then squat for 12 years on the lessee.