import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String s = br.readLine(); br.close(); int[] cnt = new int[10]; for (int i = 0; i < n; i++) { cnt[s.charAt(i) - '0']++; } int ans = 0; ans += cnt[3]; ans += cnt[5]; ans += cnt[7]; ans += cnt[1] / 2; if (cnt[1] % 2 == 1) { int a = s.indexOf("1"); int b = s.lastIndexOf("9"); if (a != -1 && b != -1 && a < b) { ans++; } } System.out.println(ans); } }