If you're counting Gibraltar, then you also have to count Akrotiri and Dhekelia, a British overseas territory that borders Cyprus. So the UK borders either 1 country (if you don't include overseas territories) or 3 countries (if you do include them), but not 2.