#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> mas(n);
  for (int i = 0; i < n; ++i) cin >> mas[i];
  sort(mas.begin(), mas.end());
  int time = 10;
  int amount = 0;
  int penTime = 0;
  int stch = 0;
  int i = 0;
  while (time <= 720 && i < mas.size()) {
    if (time + mas[i] <= 720) {
      ++amount;
      time += mas[i];
      if (time > 360) {
        penTime += time - 360;
      }
      ++i;
    } else
      break;
  }
  cout << amount << endl << penTime << endl;
  return 0;
}
