#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"l=sorted(map(int,open(0).read().split()[1:]))\n"
"a=sum(l)\n"
"if a%10:print(a);exit()\n"
"for t in l:\n"
" if t%10:print(a-t);exit()\n"
"print(0)\n"
"\"";
  system(s);
  return 0;
}            