use std::io;
fn main() {
let mut lines = io::stdin().lines();
let dim = lines.next().unwrap().unwrap();
let mut split = dim.split(" ");
let n: usize = split.next().unwrap().parse().unwrap();
let m: usize = split.next().unwrap().parse().unwrap();
let mut map: Vec<String> = Vec::with_capacity(n);
let mut start: (usize, usize) = (0, 0);
let mut end: (usize, usize) = (0, 0);
let mut cows = 0;
for y in 0..n {
let line = lines.next().unwrap().unwrap();
if start == (0, 0) {
if let Some(x) = line.find('*') {
start = (y, x);
end = (n, line.rfind('*').unwrap())
}
} else {
if y > start.0 {
if line.find('*').is_none() {
end = (y - 1, end.1);
}
cows += line
.chars()
.enumerate()
.fold(0, |acc, (i, c)| if i > start.1 && i < end.1 && c == '@' { acc + 1 } else { acc + 0 });
}
}
}
println!("{start:?}, {end:?}, {cows}")
}