#include <bits/stdc++.h>
using namespace std;
int n, a[110], tim, ans, p;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    tim += a[i];
    if (tim > 350 && tim <= 710) ans += tim - 350;
    if (tim > 710) break;
    p = i;
  }
  cout << p << ' ' << ans << endl;
  return 0;
}
