#include <bits/stdc++.h>
using namespace std;
int n, m;
bool isWall(int y, int x, const vector<string> &buf) {
  if (x < 0 || x >= m) return true;
  return (buf[y][x] == '#');
}
int main() {
  cin >> n >> m;
  vector<string> buf;
  for (int i = 0; i < n; i++) {
    string line;
    cin >> line;
    buf.push_back(line);
  }
  int curx = 0, cury = 0, dir = 1;
  long long ans = 0;
  int le = curx, ri = curx;
  while (cury < n - 1) {
    if (buf[cury + 1][curx] == '.') {
      cury++;
      ans++;
      le = ri = curx;
      continue;
    }
    if (isWall(cury, le - 1, buf) && isWall(cury, ri + 1, buf)) {
      ans = -1;
      break;
    }
    int nx = curx + dir;
    if (isWall(cury, nx, buf)) {
      dir *= -1;
      ans++;
      if (dir > 0) {
        ans += ri - curx;
        curx = ri;
      } else {
        ans += curx - le;
        curx = le;
      }
    } else if (buf[cury][nx] == '+') {
      buf[cury][nx] = '.';
      ans++;
      dir *= -1;
      if (dir > 0) {
        ans += ri - curx;
        curx = ri;
      } else {
        ans += curx - le;
        curx = le;
      }
    } else {
      ans++;
      curx = nx;
      if (dir > 0)
        ri = nx;
      else
        le = nx;
    }
  }
  if (ans == -1)
    cout << "Never\n";
  else
    cout << ans << endl;
  return 0;
}
