#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int a[n], i;
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    int acc = 10;
    int penalty = 0, t;
    for (i = 0; i < n; i++) {
      if (acc + a[i] > 720) break;
      acc += a[i];
      if (acc >= 360) {
        penalty += acc - 360;
      }
    }
    cout << i << ' ' << penalty << endl;
  }
  return 0;
}
