#include <bits/stdc++.h>
inline int gcd(int a, int b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
using namespace std;
int main() {
  int n, a[101];
  cin >> n;
  for (int i = (0); i < (n); i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int ct = 0;
  int sum = 0;
  while (ct < n && sum + a[ct] <= 350) {
    sum += a[ct++];
  }
  int num = ct, penalty = 0;
  for (int i = ct; i < n; i++) {
    if (sum + a[i] <= 710) {
      num++;
      sum += a[i];
      penalty += sum - 350;
    } else
      break;
  }
  cout << num << " " << penalty << endl;
  return 0;
}
