#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j;
  int n;
  vector<int> v;
  cin >> n;
  v.resize(n);
  for (i = 0; i < n; ++i) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  int curt = -350;
  int res = 0;
  for (i = 0; i < n; ++i) {
    curt += v[i];
    if (curt > 360) break;
    res += max(curt, 0);
  }
  cout << i << " " << res << endl;
  return 0;
}
