COUNT(...) OVER(...)

I'm trying to learn about analytic functions, more specifically the
OVER() clause applied to COUNT() and AVG() functions. I've read the SQL
Reference and I've found several examples in Google but I still can't
grasp the concept.

What follows is a simplified example based upon a real life scenario.
I'll probably fix it by adding as many subqueries as necessary so that's
not an issue. But I'd like to know whether it can be solved with
analytic functions and eventually understand how to use them.

I also need to calculate the number of deliveries. In the first table I
separated the different deliveries with blank lines; the figures should be:

customer_type nr_of_deliveries

============= ================
Type A 3
Type B 3

The database design lacks a "deliveries" table: it links routes with
invoices and I'm not allowed to change that.

I've determined that counting the number of different customers per
route is an acceptable approximation (a driver never goes twice to the
same address in the same route) and I can calculate the number of
deliveries for any given route using a simple GROUP BY ro.route_id but I
can't calculate it by other criteria (for instance, when the main query
needs to be grouped by customer_type).