Javascript characters remaining