#include<iostream>
using namespace std;
int main(void){
    long long n,a[10000],min=1000000,max=-1000000,sum=0;
     
    cin>>n;
    for(int i=0;i<n;i++){
    cin>>a[i];
    if(a[i]<min){min=a[i];}
    if(a[i]>max){max=a[i];}
    sum=a[i]+sum;
    }
    cout<<min<<" "<<max<<" "<<sum<<endl;
    
}

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <random>
#include <stack>

using namespace std;

typedef long long ll;
typedef long double ld;

#define int ll
#define double ld
#define loop(i, n) for(int i = 0; i < (int)n; ++i)
#define loop1(i, n) for(int i = 1; i <= (int)n; ++i)
#define F first
#define S second
#define pb push_back
#define pi pair <int, int>
#define all(x) begin(x), end(x)
#define ti tuple <int, int, int>
#define Point Vect
#define mkt make_tuple
#define no {cout << -1; return;}

void solve() {
    int p, q, r;
    cin >> p >> q >> r;
    cout << min({ p + q, q + r, p + r });
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //int t; cin >> t; loop(i, t)
    solve();
    return 0;
}