#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int sum = 0, cnt = 0, pen = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    if (sum > 710) break;
    ++cnt;
    pen += max(sum - 350, 0);
  }
  cout << cnt << " " << pen << "\n";
  return 0;
}
