There are currently five.
Mr Rajoy also suggested that if Scots voted for independence, the newly created independent state would be automatically thrown out of the EU and would need to apply for membership.
"This is a fact," he said. "It's neither a value judgment nor an opinion. If part of a country integrated into the EU leaves that country, then, logically, it would be outside the EU not because I say so but because that's what the treaties say."
The SNP Government argues that if Scots vote Yes next year, there would be a seamless transition towards the newly independent nation's full membership of the EU. Scotland, it says, would negotiate its way to EU membership from a position of strength because it would, by dint of still being part of the UK, continue to be part of the EU - so-called continuity of effect.
It is confident the 18-month period between a Yes vote in September and Independence Day in March 2016 would be a realistic timetable in securing full EU membership.
Last month after the Scottish Government published its White Paper, Mr Rajoy intervened in the independence debate when he said if a "region" opted to leave a member state, then it would "remain outside the EU".
A senior Brussels source has told The Herald that even if Scotland were fast-tracked it would take at least two years to join the EU.