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