package main import ( "fmt" ) func min(a, b int64) int64 { if a < b { return a } return b } func resolve(x, y, d int64) int64 { ret := int64(0) n := min(x, d) for i := int64(0); i <= n; i++ { j := d - i if j <= y { ret += 1 } } return ret } func main() { var x, y, d int64 fmt.Scanf("%d %d %d\n", &x, &y, &d) fmt.Println(resolve(x, y, d)) }