#include using namespace std; int main(){ int x,y,z;cin>>x>>y>>z; int ans = 0; for(int i = 1; z >= i; i++){ if(!(i == x || i == y))ans++; } cout << ans << endl; }