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 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?

### Accurate 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