(我不要脸问红)
#include<bits/stdc++.h>
using namespace std;
long double a,b,c;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin>>a>>b>>c;
for(long long x=0;;x++)
{
if(int(float((a*2+b*3+c*4+x*5)/(a+b+c+x))+0.5)>=4)
{
cout<<x;
return 0;
}
}
return 0;
}