Table schema:
CREATE TABLE table_name_4 (number_of_districts__kecamatan_ INTEGER, villages VARCHAR, geographical_unit VARCHAR, number_of_regencies__kabupaten_ VARCHAR)

Question: What is the sum of the number of districts (kecamatan) in the geographical unit of java with more than 4 recencies (kabupaten) and less than 8,577 villages?
SQL: SELECT SUM(number_of_districts__kecamatan_) FROM table_name_4 WHERE geographical_unit = "java" AND number_of_regencies__kabupaten_ > 4 AND villages < 8 OFFSET 577