In this paper, a formula for the number of right cosets contained in a double coset with respect to the unimodular group of invertible (2 x 2)matrices over a Dedekind domain is developed. As applications we derive an index formula for congruence subgroups and an algorithm for the explicit calculation of products in Hecke algebras.