Write SQL query to solve given problem: How many men under the age of 23 have apps installed but are not active on their devices?. Keep the solution inside sql tag ```sql [SQL-Query] ```
SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T1.gender = 'M' AND T3.is_active = 0 AND T1.age < 23