Find the total number of students living in the male dorm (with gender M).
CREATE TABLE has_amenity (
    dormid number,
    amenid number
)

CREATE TABLE dorm_amenity (
    amenid number,
    amenity_name text
)

CREATE TABLE lives_in (
    stuid number,
    dormid number,
    room_number number
)

CREATE TABLE student (
    stuid number,
    lname text,
    fname text,
    age number,
    sex text,
    major number,
    advisor number,
    city_code text
)

CREATE TABLE dorm (
    dormid number,
    dorm_name text,
    student_capacity number,
    gender text
)
SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the total number of students living in the male dorm (with gender M). ### Input: CREATE TABLE has_amenity (
    dormid number,
    amenid number
)

CREATE TABLE dorm_amenity (
    amenid number,
    amenity_name text
)

CREATE TABLE lives_in (
    stuid number,
    dormid number,
    room_number number
)

CREATE TABLE student (
    stuid number,
    lname text,
    fname text,
    age number,
    sex text,
    major number,
    advisor number,
    city_code text
)

CREATE TABLE dorm (
    dormid number,
    dorm_name text,
    student_capacity number,
    gender text
) ### Response: SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M'