#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T sqr(const T& x) {
  return x * x;
}
template <class T>
inline void checkmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T& a, T b) {
  if (b > a) a = b;
}
const double eps = 1e-10;
inline int dcmp(double x) { return x < -eps ? -1 : x > eps; }
inline bool deq(double x, double y) { return dcmp(x - y) == 0; }
inline bool dleq(double x, double y) { return dcmp(x - y) <= 0; }
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> time(n);
  time[0] = a[0];
  for (int i = 0; i < n - 1; i++) time[i + 1] = time[i] + a[i + 1];
  int i, pen = 0;
  for (i = 0; i < n && time[i] <= 710; i++)
    if (time[i] > 350) pen += time[i] - 350;
  cout << i << ' ' << pen << endl;
  return 0;
}
