#include <bits/stdc++.h>
using namespace std;
int n, m;
char grid[102][10002];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", grid[i] + 1);
    grid[i][0] = grid[i][m + 1] = '#';
  }
  int curpos = 1;
  int curdir = 1;
  int left, right;
  left = right = 1;
  long long ans = 0;
  int i = 1;
  bool flag = false;
  while (i <= n) {
    if (i == n) {
      flag = true;
      break;
    }
    while (grid[i + 1][left] != '.' && grid[i][left - 1] == '.') left--;
    while (grid[i + 1][right] != '.' && grid[i][right + 1] == '.') right++;
    if (grid[i][left - 1] == '#' && grid[i][right + 1] == '#' &&
        grid[i + 1][left] != '.' && grid[i + 1][right] != '.')
      break;
    if (grid[i + 1][curpos] == '.') {
      ++i;
      ans++;
      left = right = curpos;
    } else if (curdir == 1) {
      if (curpos == right) {
        if (grid[i][right + 1] == '+') grid[i][right + 1] = '.';
        ans++;
        curdir = -1;
      } else {
        ans += (right - curpos);
        curpos = right;
      }
    } else {
      if (curpos == left) {
        if (grid[i][left - 1] == '+') grid[i][left - 1] = '.';
        ans++;
        curdir = 1;
      } else {
        ans += (curpos - left);
        curpos = left;
      }
    }
  }
  if (false == flag)
    printf("Never\n");
  else
    printf("%I64d\n", ans);
  return 0;
}
