import java.util.*; public class SSd { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine().trim()); String ar[] = sc.nextLine().split(" "); long mul = 1; long nums[] = new long[n]; for(int i=0;i10) mul =getSum(mul); System.out.println(mul); } static long getSum(long n){ long sum = 0; while(n!=0){ sum += n%10; n /= 10; } return sum; } }