Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.

### Tables ###
TABLE: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text )
TABLE: CREATE TABLE allergy_type ( allergy text, allergytype text )
TABLE: CREATE TABLE has_allergy ( stuid number, allergy text )

### Question ###
How many students are over 18 and do not have allergy to food type or animal type?

### Accurate SQL ###

SELECT COUNT(*) FROM student WHERE age > 18 AND NOT stuid IN (SELECT stuid FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal")