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