It is not permissible to wash the counter when you know that the ants will die, and that is your intention. Since ants are not considered dangerous to people it is not permissible to kill them, even in an indirect manner. If you are rinsing the counter in any case and your intention is not to kill the ants on Shabbat, then you may rinse it even though some ants will die.