#include <bits/stdc++.h>
using namespace std;
int n, in[205], dp[205], ans, cnt;
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i <= n - 1; i++) scanf("%d", &in[i]);
    sort(in, in + n);
    dp[0] = in[0] + 10;
    for (int i = 1; i <= n - 1; i++) dp[i] = dp[i - 1] + in[i];
    cnt = ans = 0;
    for (int i = 0; i <= n - 1; i++) {
      if (dp[i] <= 360) cnt++;
      if (dp[i] > 360 && dp[i] <= 720) {
        cnt++;
        ans += dp[i] - 360;
      }
    }
    printf("%d %d\n", cnt, ans);
  }
  return 0;
}
