There are: 9999 - 1000 + 1 =9000 4-digit numbers
There are: 9000 / 4 =2250 number that ARE divisible by 4
There are: 9000 / 5 =1800 numbers that ARE divisible by 5
There are: 9000 /20 =450 numbers that ARE divisible by 20 AND are counted twice
Since you want ALL 4-digit numbers that ARE NOT divisible by 4 or 5, then we have:
9000 - [2250 + 1800 - 450] ==9000 - 3,600 = 5400 4-digit numbers that are NOT divisible by 4 or 5.