Game involving probability

Here is a nice probability problem I saw in class about a week ago. It involves playing a game.

Consider a game where the player has initially $\displaystyle d$ dollars. The player tosses an unfair die (or flips an unfair coin, or whatever) so that the probability of winning is $\displaystyle p$. If he wins he earns a dollar, if he loses he loses a dollar. This is played until one of two situations occurs: either he reachers a certain amount $\displaystyle n$ or he is bankrupt i.e. he loses all his money. Given $\displaystyle d,p,n$ find a formula that will give the probability of succes (meaning he reaches $\displaystyle n$).

According to our textbook this is a classic going all the way back to Bernoulli (I just forgot which one it is :D).