RT
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll n,m,k,ans; int main() { cin>>n>>m>>k; if(n%2){ k--; n--; } if((n/2)<m){ k-=(m-n/2); m=n/2; } while(k>0){ m-=1; n-=2; k-=3; } cout<<m; return 0; }