if (arg instanceof ExprDouble || arg instanceof ExprInteger) {
return 1;
} else if (arg instanceof ExprArray) {
int count = 0;
ExprArray arr = (ExprArray) arg;
int rows = arr.rows();
int cols = arr.columns();
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
count += count(arr.get(i, j), any);
}