// Arup Guha
// 8/13/2026
// Solution to 2026 UCF Locals Problem: Contest Score Dream

using namespace std;
#include <bits/stdc++.h>

int main() {

    // Read in times to solve.
    int n;
    cin >> n;
    vector<int> times(n);
    for (int i=0; i<n; i++)
        cin >> times[i];

    // Sort it.
    sort(times.begin(), times.end());

    int curT = 0, res = 0, pen = 0;
    for (int i=0; i<n; i++) {
        curT += times[i];

        // Too late.
        if (curT > 300) break;

        // Update status.
        res++;
        pen += curT;
    }

    // Ta da!
    cout << res << " " << pen << endl;
    return 0;
}
