#include <stdio.h>
#include <string.h>

int main(void) {
  int i, n, now = 0, min = 120, s;
  scanf("%d", &n);
  for(i = 0; i < n; ++i) {
    scanf("%d", &s);
    now += s;
    if(s % 10 && min > s) min = s;
  }
  if(now % 10) printf("%d", now);
  else {
    if(min == 120) printf("0");
    else printf("%d", now - min);
  }
  return 0;
}