#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e18;
const long long minN = -1e18;
const int INF = 2e9;
const long long MOD = 1e9 + 7;
const long long MOD1 = 998244353;
const int baseHash = 331;
const int bigNumLength = 5000;
const long double PI = acos(-1);
const int limit = 2e5 + 5;
const int limit1 = 1e6 + 5;
const int limit2 = 1e3 + 5;
pair<int, int> dir[] = {{0, 1}, {1, 0},  {0, -1}, {-1, 0},
                        {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
pair<int, int> NON = {-1, -1};
int n, m;
char c[105][10005];
int nearLeft[105][10005], nearRight[105][10005];
int blockLeft[105][10005], blockRight[105][10005];
int brickLeft[105][10005], brickRight[105][10005];
void init() {
  for (int i = (1); i <= (n - 1); ++i) {
    nearLeft[i][0] = -1;
    nearRight[i][m + 1] = -1;
    blockLeft[i][0] = 0;
    blockRight[i][m + 1] = 0;
    brickLeft[i][0] = -1;
    brickRight[i][0] = -1;
    for (int j = (1); j <= (m); ++j) {
      nearLeft[i][j] = -1;
      if (nearLeft[i][j - 1] != -1) nearLeft[i][j] = nearLeft[i][j - 1] + 1;
      if (c[i + 1][j] == '.') nearLeft[i][j] = 0;
      blockLeft[i][j] = blockLeft[i][j - 1] + 1;
      blockLeft[i][j] = min(blockLeft[i][j], c[i][j] == '#' ? 0 : INF);
      brickLeft[i][j] = -1;
      if (brickLeft[i][j - 1] != -1) brickLeft[i][j] = brickLeft[i][j - 1] + 1;
      if (c[i][j] == '+') brickLeft[i][j] = 0;
    }
    for (int j = (m); j >= (1); --j) {
      nearRight[i][j] = -1;
      if (nearRight[i][j + 1] != -1) nearRight[i][j] = nearRight[i][j + 1] + 1;
      if (c[i + 1][j] == '.') nearRight[i][j] = 0;
      blockRight[i][j] = blockRight[i][j + 1] + 1;
      blockRight[i][j] = min(blockRight[i][j], c[i][j] == '#' ? 0 : INF);
      brickRight[i][j] = -1;
      if (brickRight[i][j + 1] != -1)
        brickRight[i][j] = brickRight[i][j + 1] + 1;
      if (c[i][j] == '+') brickRight[i][j] = 0;
    }
  }
}
bool nextRow(int x, int y) {
  bool ok = false;
  if (nearLeft[x][y] == -1 && nearRight[x][y] == -1) return false;
  if (nearLeft[x][y] != -1 && blockLeft[x][y] > nearLeft[x][y]) ok = true;
  if (nearRight[x][y] != -1 && blockRight[x][y] > nearRight[x][y]) ok = true;
  return ok;
}
int calc(int &x, int &y, int &dir) {
  bool ok = false;
  int ans = 0;
  int lastLeft = y, lastRight = y;
  while (!ok) {
    if (dir == 0) {
      if (nearRight[x][y] != -1 && blockRight[x][y] > nearRight[x][y] &&
          (brickRight[x][lastRight] + lastRight - y > nearRight[x][y] ||
           brickRight[x][lastRight] == -1)) {
        ans += nearRight[x][y] + 1;
        y += nearRight[x][y];
        ++x;
        ok = true;
      } else if (nearRight[x][y] != -1 && blockRight[x][y] > nearRight[x][y]) {
        ans += brickRight[x][lastRight] + lastRight - y;
        y = brickRight[x][lastRight] + lastRight - 1;
        lastRight += brickRight[x][lastRight] + 1;
      } else {
        int dist = blockRight[x][y] - 1;
        if (brickRight[x][lastRight] != -1 &&
            brickRight[x][lastRight] + lastRight - y - 1 < dist) {
          ans += brickRight[x][lastRight] + lastRight - y;
          y = brickRight[x][lastRight] + lastRight - 1;
          lastRight += brickRight[x][lastRight] + 1;
        } else {
          y += dist;
          ans += dist + 1;
        }
      }
    } else {
      if (nearLeft[x][y] != -1 && blockLeft[x][y] > nearLeft[x][y] &&
          (brickLeft[x][lastLeft] + y - lastLeft > nearLeft[x][y] ||
           brickLeft[x][lastLeft] == -1)) {
        ans += nearLeft[x][y] + 1;
        y -= nearLeft[x][y];
        ++x;
        ok = true;
      } else if (nearLeft[x][y] != -1 && blockLeft[x][y] > nearLeft[x][y]) {
        ans += brickLeft[x][lastLeft] + y - lastLeft;
        y = lastLeft - brickLeft[x][lastLeft] + 1;
        lastLeft -= brickLeft[x][lastLeft] + 1;
      } else {
        int dist = blockLeft[x][y] - 1;
        if (brickLeft[x][lastLeft] != -1 &&
            brickLeft[x][lastLeft] + y - lastLeft - 1 < dist) {
          ans += brickLeft[x][lastLeft] + y - lastLeft;
          y = lastLeft - brickLeft[x][lastLeft] + 1;
          lastLeft -= brickLeft[x][lastLeft] + 1;
        } else {
          y -= dist;
          ans += dist + 1;
        }
      }
    }
    if (!ok) dir ^= 1;
  }
  return ans;
}
void solveProblem() {
  init();
  int row = 1, col = 1, dir = 0;
  long long ans = 0;
  while (row != n) {
    if (!nextRow(row, col)) {
      cout << "Never" << '\n';
      return;
    }
    ans += calc(row, col, dir);
  }
  cout << ans << '\n';
}
void fastInput() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void readInput() {
  cin >> n >> m;
  for (int i = (1); i <= (n); ++i) {
    for (int j = (1); j <= (m); ++j) {
      cin >> c[i][j];
    }
  }
}
int main() {
  fastInput();
  readInput();
  solveProblem();
}
