#include <bits/stdc++.h>
using namespace std;
int d2x[] = {1, -1, 0, 0, 1, -1, 1, -1};
int d2y[] = {0, 0, 1, -1, 1, -1, -1, 1};
int d3x[] = {1, -1, 0, 0, 0, 0};
int d3y[] = {0, 0, 1, -1, 0, 0};
int d3z[] = {0, 0, 0, 0, 1, -1};
struct edge {
  int from, to, w;
  edge(int from, int to, int w) : from(from), to(to), w(w) {}
  bool operator<(const edge& e) const { return w > e.w; }
};
const double EPS = (1e-9);
int n, temp, sum = 0;
vector<int> a, b;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    a.push_back(temp);
  }
  sort(((a).begin()), ((a).end()));
  for (int i = 0; i < ((int)((a).size())); ++i) {
    if (sum + a[i] <= 710) {
      sum += a[i];
      b.push_back(a[i]);
    } else {
      break;
    }
  }
  sum = 350LL;
  for (int i = 0; i < ((int)((b).size())); ++i) {
    if (sum > 0) {
      if (sum > b[i]) {
        sum -= b[i];
        b[i] = 0;
      } else {
        b[i] -= sum;
        sum = 0;
      }
    } else {
      b[i] += b[i - 1];
    }
  }
  sum = 0LL;
  for (int i = 0; i < ((int)((b).size())); ++i) sum += b[i];
  cout << ((int)((b).size())) << " " << sum;
  return 0;
}
