#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
template <class T>
typename T::value_type arr_sum(const T& v, int n) {
  typename T::value_type sum = 0;
  for (int i = (0); i < (n); ++i) sum += v[i];
  return sum;
}
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  ;
  sort(a.begin(), a.end());
  vector<int> s(n);
  partial_sum(a.begin(), a.end(), s.begin());
  int tasks = 0;
  int time = 0;
  for (int i = (0); i < (s.size()); ++i) {
    if (s[i] <= 350) {
      ++tasks;
    } else if (s[i] <= 710) {
      ++tasks;
      time += s[i] - 350;
    } else {
      break;
    }
  }
  cout << tasks << " " << time;
}
