#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:16000000")
const int INF = 1e9;
const double EPS = 1e-8;
const double PI = 2 * acos(0.);
char s[110][10010];
int main() {
  int n, m;
  scanf("%d%d ", &n, &m);
  for (int i = 0; i < n; ++i) {
    s[i][0] = '#';
    gets(s[i] + 1);
    s[i][m + 1] = '#';
  }
  long long ans = 0;
  int pos = 1;
  int dir = 1;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i + 1][pos] == '.') {
      ++ans;
      continue;
    }
    int l = pos;
    int r = pos;
    bool f = false;
    while (!f) {
      if (s[i][l - 1] == '#' && s[i][r + 1] == '#') {
        puts("Never");
        return 0;
      }
      if (dir == 1) {
        for (int j = r + 1;; ++j) {
          if (s[i][j] == '.') {
            ++ans;
            ++r;
            pos = r;
            if (s[i + 1][pos] == '.') {
              f = true;
              ++ans;
              break;
            }
          } else {
            if (s[i][j] == '+') {
              s[i][j] = '.';
            }
            pos = l;
            ans += r - l + 1;
            dir = -1;
            break;
          }
        }
      } else {
        for (int j = l - 1;; --j) {
          if (s[i][j] == '.') {
            ++ans;
            --l;
            pos = l;
            if (s[i + 1][pos] == '.') {
              f = true;
              ++ans;
              break;
            }
          } else {
            if (s[i][j] == '+') {
              s[i][j] = '.';
            }
            pos = r;
            ans += r - l + 1;
            dir = 1;
            break;
          }
        }
      }
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
