#include <bits/stdc++.h>
using namespace std;
const int N = 10000 + 77, NN = 100 + 77;
int n, m;
char S[NN][N];
set<int> T[NN];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%s", S[i] + 1);
  for (int i = 1; i <= n; ++i) {
    T[i].insert(0);
    T[i].insert(m + 1);
    for (int j = 1; j <= m; ++j)
      if (S[i][j] == '+' || S[i][j] == '#' || S[i + 1][j] == '.')
        T[i].insert(j);
  }
  int pos = 1;
  int dir = 0;
  long long A = 0;
  for (int i = 1; i < n; ++i) {
    int cnt = 0;
    while (1) {
      ++cnt;
      if (cnt > 1e5) return !printf("Never\n");
      if (dir == 0) {
        auto it = T[i].lower_bound(pos);
        int x = *it;
        if (x == m + 1)
          A += m - pos + 1, pos = m, dir ^= 1;
        else {
          if (S[i][x] == '+') {
            A += x - pos, S[i][x] = '.', pos = x - 1, dir ^= 1;
            if (S[i + 1][x] != '.') T[i].erase(x);
          } else if (S[i][x] == '#')
            A += x - pos, pos = x - 1, dir ^= 1;
          else {
            A += x - pos + 1;
            pos = x;
            break;
          }
        }
      } else {
        auto it = T[i].upper_bound(pos);
        --it;
        int x = *it;
        if (x == 0)
          A += pos, pos = 1, dir ^= 1;
        else {
          if (S[i][x] == '+') {
            A += pos - x, S[i][x] = '.', pos = x + 1, dir ^= 1;
            if (S[i + 1][x] != '.') T[i].erase(x);
          } else if (S[i][x] == '#')
            A += pos - x, pos = x + 1, dir ^= 1;
          else {
            A += pos - x + 1;
            pos = x;
            break;
          }
        }
      }
    }
  }
  printf("%lld\n", A);
  return 0;
}
