#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
int a, b, c, d, i, j, n, m, k;
int mas[301];
pair<int, int> dp[301][712];
inline void upd(pair<int, int> &a, pair<int, int> b) {
  if (b.first > a.first || (b.first == a.first && b.second < a.second)) a = b;
}
int main() {
  scanf("%d", &n);
  for (int _n((n)-1), i(0); i <= _n; i++) scanf("%d", &mas[i]);
  sort(mas, mas + n);
  memset(dp, -1, sizeof(dp));
  dp[0][0] = make_pair(0, 0);
  for (int _n((n + 1) - 1), i(0); i <= _n; i++) {
    for (int _n((711) - 1), j(0); j <= _n; j++) {
      if (dp[i][j].first == -1) continue;
      int t = 0;
      if (j + mas[i] <= 350)
        t = 0;
      else
        t = j + mas[i] - 350;
      if (j + mas[i] <= 710)
        upd(dp[i + 1][j + mas[i]],
            make_pair(dp[i][j].first + 1, dp[i][j].second + t));
      upd(dp[i + 1][j], dp[i][j]);
      upd(dp[i][j + 1], dp[i][j]);
    }
  }
  printf("%d %d\n", dp[n][710].first, dp[n][710].second);
}
