A sequence of random variables η0, η1, …, ηn, … is defined by the recurrence formula ηn = max (ηn–1 + ξn, 0) where η0 is a discrete random variable taking on non-negative integers only and ξ1, ξ2, … ξn, … is a semi-Markov sequence of discrete random variables taking on integers only. Define Δ as the smallest n = 1, 2, … for which ηn = 0. The random variable ηn can be interpreted as the content of a dam at time t = n(n = 0, 1, 2, …) and Δ as the time of first emptiness. This paper deals with the determination of the distributions of ηn and Δ by using the method of matrix factorisation.