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