main=do [x,y,d]<-getLine>>=return.map(read::String->Integer).words print$length[(x',d-x')|x'<-[0..d],x'<=x,d-x'<=y]