#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int now = 10;
  int ans = 0;
  int cnt = 0;
  while (now <= 720 && cnt < n) {
    if (now + a[cnt] <= 360) {
      now += a[cnt];
      cnt++;
    } else if (now + a[cnt] <= 720) {
      now += a[cnt];
      cnt++;
      ans += (now - 360);
    } else {
      break;
    }
  }
  printf("%d %d\n", cnt, ans);
  return 0;
}
