#include <bits/stdc++.h>
using namespace std;
char a[105][10005];
int n, m, l, r, now = 1, dir = 1;
long long cnt = 0;
inline int read(void) {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; ++i) scanf("%s", a[i] + 1);
  for (int i = 1; i < n; ++i) {
    l = now - 1;
    r = now + 1;
    if (a[i + 1][now] == '.') {
      cnt++;
      continue;
    }
    now = -1;
    while ((l && a[i][l] != '#') || (r <= m && a[i][r] != '#')) {
      if (dir) {
        cnt += r - l - 2;
        while (r <= m && a[i][r] == '.' && a[i + 1][r] != '.') r++, cnt++;
        if (a[i][r] == '.' && a[i + 1][r] == '.') {
          now = r;
          break;
        }
        dir = 0;
        cnt++;
        if (a[i][r] == '+') a[i][r] = '.';
      } else {
        cnt += r - l - 2;
        while (l && a[i][l] == '.' && a[i + 1][l] != '.') --l, cnt++;
        if (a[i][l] == '.' && a[i + 1][l] == '.') {
          now = l;
          break;
        }
        dir = 1;
        cnt++;
        if (a[i][l] == '+') a[i][l] = '.';
      }
    }
    if (now < 0) {
      puts("Never");
      return 0;
    }
    cnt += 2;
  }
  printf("%I64d\n", cnt);
  return 0;
}
