#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using pii = pair<int, int>;
using mii = map<int, int>;
const long long upper = 1e5 + 20;
const long long M = (long long)1e9 + 7;
const long long inf = (long long)1e17;
const double eps = 1e-8;
long long n;
signed main() {
  long long begtime = clock();
  ;
  cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(false);
  cin >> n;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  long long penalty = 0, done = 0, solved = 0;
  for (long long i = 1; i <= n; i += 1) {
    if (done + a[i] <= 350) {
      done += a[i];
      solved += 1;
      continue;
    }
    if (done + a[i] > 710) {
      break;
    }
    penalty -= (350 - done - a[i]);
    done += a[i];
    solved += 1;
  }
  cout << solved << ' ' << penalty << '\n';
  long long endtime = clock();
  cerr << '\n'
       << "Time elapsed: " << (endtime - begtime) * 1000 / CLOCKS_PER_SEC
       << " ms";
  return 0;
}
