how to calculate flowing fill - Search