#include <bits/stdc++.h>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define ok puts("OK");
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()

using namespace std;

int a, b, c, dp[105][105][105], ans = 1e9 + 7;

main()
{
    cin >> a >> b >> c;

    memset(dp, 0x3f3f3f3f, sizeof(dp) );

    dp[a][b][c] = 0;
    for (int i = a; i <= 100; i++)
        for (int j = b; j <= 100; j++)
            for (int k = c; k <= 100; k++)
            {
                if (i && j)
                    dp[i][j][k] = min( dp[i][j][k], dp[i - 1][j - 1][k] + 1 );
                if (i && k)
                    dp[i][j][k] = min( dp[i][j][k], dp[i - 1][j][k - 1] + 1 );
                if (j && k)
                    dp[i][j][k] = min( dp[i][j][k], dp[i][j - 1][k - 1] + 1 );
                if (i > 1)
                    dp[i][j][k] = min( dp[i][j][k], dp[i - 2][j][k] + 1 );
                if (j > 1)
                    dp[i][j][k] = min( dp[i][j][k], dp[i][j - 2][k] + 1 );
                if (k > 1)
                    dp[i][j][k] = min( dp[i][j][k], dp[i][j][k - 2] + 1 );
            }
    for (int i = 1; i <= 100; i++)
        ans = min(ans, dp[i][i][i]);

    cout << ans << endl;
}
