Write SQL query to solve given problem: How many customers in the machinery segment are in debt?. Keep the solution inside sql tag ```sql [SQL-Query] ```
SELECT COUNT(c_custkey) FROM customer WHERE c_acctbal < 0 AND c_mktsegment = 'MACHINERY'