#include <bits/stdc++.h>
using namespace std;
int n, a[500], cur = 0, x, sum = 10, i = 0;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (i = 0; i < n && sum + a[i] <= 720; i++, cur += max(0, sum - 360))
    sum += a[i];
  cout << i << " " << cur << endl;
}
