We call number $N$ a twisted prime if we turn all the 6-es in 9s and all the 9s in 6-es and it remains a prime(If it has no 6-es or 9s it is not twisted). How many twisted primes there are? ($N \leq 20000$)
Source: School friend. Is there a way to really calculate it except counting to 20000?